survivejs / react-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/react/introduction/
2.02k stars 366 forks source link

Hot Module Replacement is disabled error. #389

Closed siegesmund closed 8 years ago

siegesmund commented 8 years ago

I'm getting this error in the Chrome console: Uncaught Error: [HMR] Hot Module Replacement is disabled.

It's referenced in this issue, and the solution offered here solves the problem. https://github.com/webpack/webpack/issues/1151

Still, it seems a little nicer to have those settings in the config file.

Using Node 4.3.1 and Chrome 50.0.2661.86

bebraw commented 8 years ago

How did you end up fixing it? The thread is a little confusing and webpack source conflicts with some of that these days.

siegesmund commented 8 years ago

I added the hot and inline flags to the npm start script in package.json, and commented them out in the webpack config file. Those options are now invoked with: webpack-dev-server --hot --inline

bebraw commented 8 years ago

There's actually a little inconsistency in webpack here. I read from the source that it sets HotModuleReplacementPlugin only through cli. If you use webServer field, it has to be set explicitly.

I'll be moving the book to use a little boilerplate in the near future. That will solve this issue as we get something consistent to run.

Thanks for the report.

bebraw commented 8 years ago

dev is running boilerplate now. Release soon. 👍