We are starting multiple entrypoints in the same webpack dev server and expect 'chunkhash' to be available but instead it causes this error:
ERROR in chunk app1 [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)
ERROR in chunk app2 [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)
ERROR in chunk app3 [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)
ERROR in chunk app4 [entry]
[name].[chunkhash].js
Cannot use [chunkhash] for chunk in '[name].[chunkhash].js' (use [hash] instead)
As I understand this option should be available, as it is in a production build, so is it a bug?
For now we have made it use 'hash' in dev server and 'chunkhash' in production build.
Thanks!
Yannis
Something prevents to from using chunkhash. i. e. HMR?
I can confirm that this problem is related to using [chunkhash]
in conjunction with webpack-dev-server --hot --inline
.
Since this is the expected behavior, I'm closing it.
You shouldn't use [chunkhash] with webpack-dev-server. Also, remove new webpack.NamedModulesPlugin()
from plugins in Webpack's config, or you'll get an error while separating the manifest to another file. "Don鈥檛 use [chunkhash] in development since this will increase compilation time.", from docs.
Most helpful comment
I can confirm that this problem is related to using
[chunkhash]
in conjunction withwebpack-dev-server --hot --inline
.Since this is the expected behavior, I'm closing it.