react-hot-loader: Hot reload not working with webpack2 and react-hot-loader3
I updated my small project to webpack2 and switched to react-hot-loader3 but now everytime I try to change a react component I just get the following output:
[HMR] Waiting for update signal from WDS...
app-7a88884….js:39514 [WDS] Hot Module Replacement enabled.
2app-7a88884….js:39514 [WDS] App updated. Recompiling...
app-7a88884….js:39514 [WDS] App hot update...
app-7a88884….js:39656 [HMR] Checking for updates on the server...
app-7a88884….js:39621 Ignored an update to unaccepted module 530 -> 535 -> 514 -> 1290
app-7a88884….js:96157 [HMR] The following modules couldn't be hot updated: (They would need a full reload!)
app-7a88884….js:96159 [HMR] - 530
app-7a88884….js:96164 [HMR] Nothing hot updated.
app-7a88884….js:39637 [HMR] App is up to date.
Right now it does not even try do a full reload anymore. The Source code can be found here: https://gitlab.fkrauthan.de/simply-sailing/west-coast-sailing-club
Just run npm install in the web-ui folder and after that run npm start webpack:development
The file I try to change is in web-ui/src/common/modules/static/components/HomePage.js
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 45 (1 by maintainers)
I solved a similar problem.
I had the issue with hot.module.accept not triggering when I switched to webpack2. I simply saw nothing relating to HMR in the console, but WDS printed the normal stuff about
"App updated. Recompiling..."I had to simply update to webpack2:
npm install webpack-dev-server@beta --save-devPreviously I was running
^1.16.2. Perhaps someone else here has done the same mistake.Found the root of the problem:
My
index.jsimportedroutestoo, and it probably messed the dependency tree. I removed it from there. Now everything works. So I suggest checking what is beingimported.Hi there. Trying to setup from scratch I’ve got one problem - HMR logs is OK in console, but browser content doesn’t updates.
https://cl.ly/212B1i3G420N
I’m runing webpack-dev-server CLI with --hot --inline options.
@ElForastero did you figure it out?
@calesce I’ve pushed a new version with fixes (and a shrinkwrap file to make sure that the dependencies are going to be the same). I found out that not my
module.hot.accept('./components/DevAppRoot', () => {gets called but instead if I add amodule.hot.accept('../common/routes/create', () => {that handler gets called (that file assembles my route config). Is that the intended behaviour? Do i need to re render the application if my route file gets changed?Edit I just tried re-rendering my app within that callback but my output just changes to:
But the component itself is still showing the old content.
@pgsandstrom I had been wresting with this issue on and off for a couple of days now. Thanks for the tip, after I switched to
webpack-dev-server@betaeverything started to work.EDIT: I actually upgraded to
webpack-dev-server@2.3based on @jquintozamora’s comment and everything still works fine.@pgsandstrom thanks!! In fact, since yesterday you can do just npm install webpack-dev-server --save-dev and will be installing version 2.2.1.
Hi all;
react-routerv4 definitely plays a lot nicer with HMR!I have an example set up in my
code-split-componentmodule that shows usage of RR4 with RHL3, and it includes code splitting using Webpack 2’sSystem.importAPI._Update_: turns out I didn’t have the babel plugin included in my example above. Unfortunately RHL3 doesn’t play nicely with the declarative
CodeSplitcomponent. It requires you to update a component twice and then only shows the previous update. Every subsequent update hot reloads the previous update. I’ve had to remove RHL3 from my example, so it won’t be much use to many. Sorry.So here are my findings:
I had
routes.jsfile that looked likeAnd
Root.jsThis combination led to
unacceptedstate of a module, because for some reason the module queue (on webpack side) had the one with the_mainin it.Seemed like the
import Home from './components/Home'in therouteswas actually the key to this failure. I moved all the routes toRootand it works.