Webpack: Cannot use 'chunkhash' in webpack dev server

Created on 25 Apr 2016  路  3Comments  路  Source: webpack/webpack

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

question

Most helpful comment

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tjorriemorrie picture Tjorriemorrie  路  3Comments

sairion picture sairion  路  3Comments

olalonde picture olalonde  路  3Comments

haohcraft picture haohcraft  路  3Comments

zerkalica picture zerkalica  路  3Comments