0

I'm using the (now-deprecated) CodingZeal react boilerplate repo as a base for a project and am running into an error.

I've cloned the repo to test with and (with the commit as of 4/1/2016 checked out: 406662f) can run that just fine and see the public/client.js file generated.

However, in my project I get Module not found: Error: Cannot resolve module 'webpack-dev-server/app' when I run webpack-dev-server.

This is due to /webpack/development.js where I have the following:

config.entry.app.unshift(
  'webpack-dev-server/app?http://localhost:8080',
  'webpack/hot/only-dev-server'
)

It doesn't seem to like that first line.

In /webpack/base.js that is required in development.js I have:

...
entry: {
  app: [path.resolve(__dirname, '../global.js'), path.resolve(__dirname, '../app.js')]
},
output: {
  path: path.resolve(__dirname, '../public'),
  filename: 'bundle.js'
}
...

The /public directory exists, but no file ever shows up there.

Note that in the reference repo, their main folder is /client, where I've decided to call mine /app. I think this is arbitrary and shouldn't affect anything. I took care to update all instances of client to app in my project.

Thoughts on why this is happening?

1 Answer 1

1

I took care to update all instances of client to app in my project.

You are correct, except that you replaced an instance of client that wasn't referring to your files. webpack-dev-server/client refers to the module client inside webpack-dev-server. Changing it back should solve your issue:

config.entry.app.unshift(
  'webpack-dev-server/client?http://localhost:8080',
  'webpack/hot/only-dev-server'
)
Sign up to request clarification or add additional context in comments.

1 Comment

ah. I was wondering what this module could be that had to do with what I'd named my directory but had never installed :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.