-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot reload module failed : Cannot apply update. Need to do a full reload! #395
Comments
Um, I setup another project and seems working fine. The project that failed with "Cannot apply update. Need to do a full reload!" is using with vagrant. Wonder it could be related to the problem. Need to research more on that, but if you have any insight, please let us know too. Thanks. |
Are you proxying, using the iframe mode or referencing your scripts inline to the server run with Vagrant? It may be that the something in that server set up is conflicting with how the webpack-dev-server operates. I had an issue when trying to use webpack alongside Apache and Wordpress where things in Wordpress were impacting the webpack-dev-server: Wordpress was rewriting URLs and stripping the port required for proxying, and was making all referenced assets absolute URLs rather than starting with a '/' which meant Webpack couldn't reference them. |
I have the exact same issue. I narrowed it down to the same line. It adds module ID 0 as a parent. I setup an example repo reproducing the issue both with the CLI and a separate server. |
Webpack has many different ways to set up a project, and some of them conflict. The docs aren't too clear on exactly what combination of which you should be using when, and using virtual machines or over networks also complicates issues. I have a working simple repo here with hot module reloading: https://github.com/mummybot/webpack-hmr-network-multiple-entry-points-issue |
Have you tried if (module.hot)
module.hot.accept() https://webpack.github.io/docs/hot-module-replacement-with-webpack.html#what-is-needed-to-use-it I know more than a few people who have forgotten this, and didn't know why HMR was not working. |
I'm managed to fix the issues I have. Please note that I'm using The following steps are what I changed
Hope it helps :) |
@iroy2000 Could you post some more details on step 2 of your resolution? Much appreciated! |
Spent hours to this issue before found that stateless functional components of React 0.14 are not supported. |
I installed this plugin https://github.com/gaearon/react-transform-hmr and now my webpack doesn't do full reload anymore! 👯 |
@AriaFallah: Works for me. Did not notice that on documentation at first. |
fyi, if you're using |
I'm not immediately certain from the documentation on where exactly to put this code. |
Please, explain where should we put these 2 lines;
|
the new location for the relevant documentation is https://webpack.js.org/guides/hot-module-replacement. after reading it, however, i think my issue is that the module in question uses |
For those wondering where to place the recommended snippet: if (module.hot)
module.hot.accept() I tried the |
I was trying to debug why the HMR do full page reload everytime ...
[HMR] Cannot apply update. Need to do a full reload!
And I tried to look into the module
286
and I don't know why it is not accepted ...... And I start doing some tracing ...
( Not sure if the following is useful information or not )I found
parent.hot._acceptedDependencies
has nothing in itAnd my webpack config is very common, and I used the CLI
CLI:
webpack-dev-server --hot --progress --colors --inline --content-base ./docroot
webpack config:
.
.
.
Any help will be appreciated, thanks.
According to the documentation -- Hot Module Replacement with Inline mode on CLI
Nothing more is needed. --inline --hot does all the relevant work automatically. The CLI of the webpack-dev-server automatically adds the special webpack/hot/dev-server entry point to your configuration. #
The text was updated successfully, but these errors were encountered: