Webpack are throwing this error all of a sudden:
TypeError: webpack.validateSchema is not a function
Everything was working fine
I got the same error as well. I locked my version of webpack-dev-server in my package.json file and that prevented the error from occurring. That doesn't fix the root problem of the bug though.
This is the version of webpack-dev-server that I'm using but I'm sure later versions work as well: "webpack-dev-server": "2.1.0-beta.9",
I got this problem because I had an older global version of webpack installed that was somehow conflicting with the project-specific webpack.
I first un-installed the global (older) webpack by running:
npm uninstall webpack -g
Then I ran my project-specific webpack. On windows webpack.cmd resides in node_modules.bin\, but if you run webpack via an npm task, npm will search the .bin folder automatically, so no need to specify that path explicitly.
The functioning npm run task in my package.json looks as follows:
"scripts": {
"webpack": "webpack -w --config ./config/dev.js --progress"
}
As explained in this GitHub issue, you need to update webpack to webpack 2.1.0-beta.26
or later. Since the last v2.1 release is beta.28, you should require webpack@^2.1.0-beta.28
.
Note that one of the breaking changes introduced in beta.26 is that you need to specify the full name of loaders, e.g. replace loader: 'babel'
with loader: 'babel-loader'
.
Got the same issue when we upgraded angular/cli to 1.6.3 and when we test the ng -v we get an error towards webpack. So we happen to uninstall webpack, do an cache clean and then installed the webpack again globally. It resolved the issue