pro-mern-stack icon indicating copy to clipboard operation
pro-mern-stack copied to clipboard

Libraries Bundle - npm run watch - deprecation notice

Open cfoutlier opened this issue 7 years ago • 3 comments

Running the "npm run watch" command could cause an error. Pay attention to the notes in the error as seen blow


Error: Deprecation notice: CommonsChunkPlugin now only takes a single argument. Either an options object or the name of the chunk. Example: if your old code looked like this: new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js') You would change it to: new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js' })

cfoutlier avatar Jun 25 '17 05:06 cfoutlier

After making the changes in the above statement, I now receive a 404 error on both app.bundle.js and vendor.bundle.js.

This occurred both in the copy that I was developing, and from a copy that I pulled from github (and making the aforementioned changes to the CommonsChunkPlugin. I am unsure of where to go from here.

JustinHeidema avatar Jun 29 '17 02:06 JustinHeidema

I am very new to all of this so use the suggestion with caution, it may come down to my installation being a different version.. likely newer than what is installed in the book. That change did work for me though, specifically in the "Libraries Bundle" section in chapter 7. If you are doing it an earlier point etc that may be the reason it is not working.

cfoutlier avatar Jun 29 '17 03:06 cfoutlier

Justin it depends on the version webpack you have installed in your package.json file. Vasan is using webpack 1.

were you able to resolve your issue?

arrmixer avatar Jul 05 '17 22:07 arrmixer