"Uncaught Error: [HMR] Hot Module Replacement is disabled." appearing when adding special entry point
See original GitHub issueI’m using webpack for tota11y and absolutely loving it, but I keep running into a problem with HMR and my config.
Following the instructions at http://webpack.github.io/docs/webpack-dev-server.html#hot-mode, I’ve added webpack/hot/dev-server
as an entry point. Running
webpack-dev-server --hot
Everything works as expected, but the problem comes when I build with webpack -p
. In doing so, I get the following error when running my bundle in a browser:
Uncaught Error: [HMR] Hot Module Replacement is disabled.
Grepping through my bundle I can see that error message, but why is this hot reloading code in my bundle?
I’ve since removed that bit from the entry field in my config, and hot reloading seems to work fine. So I remain a bit confused: do I not actually need webpack/hot/dev-server
in my config? Are the docs outdated?
I checked around for this error but couldn’t find anything, so perhaps my problem runs deeper than that.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:29 (4 by maintainers)
The docs are wrong… 😢
Just use
webpack-dev-server --hot --inline
and don’t anything special about webpack-dev-server or HMR to your webpack.config.js.Hot Module Replacement is disabled.
means theHotModuleReplacementPlugin
is not used.--hot
adds it. (because the CLI have access to your webpack configuration)hot: true
doesn’t add it. (because the API doesn’t have access to your webpack configuration)