webpack: WebpackOptionsValidationError does not throw correctly on Node 7.2.1 (webpack 2.2.0-rc.1)

Webpack 2.2.0-rc.1 has an error messaging bug.

Current behavior is throwing an error, but it does not display where the error comes from, nor does it display the recommended fixes.

  1. Add some obvious error in your webpack config such as using modulesDirectories instead of modules under resolve.
  2. Ensure you have Node 7.2.1 (latest version as of 12/19/2016).
  3. run webpack-dev-server --hot --inline --colors and --progress arguments optional.
  4. See that the error is thrown, but no explanation as to why it throws is given.
  5. Switch to LTS (6.9.2 as of 12/19/2016) and run the same command.
  6. See the error being thrown, but now we have a description of what the error is.

The expected behavior is that it should only ouput the error in the CLI, rather than leveraging Node’s internal error messaging.

Tested on OS X 10.11.6, Node 7.2.1 & Node 6.9.2, and using iTerm2 emulator.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I have this same bug under node v7.3.0 & v7.4.0 (have not tested other 7.x versions) with webpack v2.2.0-rc3

It does work on the latest(v6.9.3) LTS version however.

@chenfanggm you can set your package.json’s webpack version to the git url, and npm will pull the latest code from master.

Interesting, I can’t find anything in the Node.js v7.3.0 changelog about something that could have fixed this. Since no others complained about this, I’m closing this.