Closed SCullman closed 6 years ago
This is by design. https://medium.com/@rajaraodv/webpack-hot-module-replacement-hmr-e756a726a07
HMR is informed about the code changes and tries to fetch the changes from the second server instead of the webdevserver. This fails with a 404, and it reloads the whole page.
HMR needs to know where to pull the changes from. Add the following options to webpack.config.js:
output: {
....
publicPath: 'http://localhost:8080/'
},
...
devServer: {
...
headers: { "Access-Control-Allow-Origin": "*" },
...
},
Enable "Preserve log" in Chrome in the console options.
Description
Instead of replacing the modified code, the whole page gets reloaded
Repro code
Expected results
On an App update, it should just reload the new js module, and the state should remain.
Actual results
However, the page including the new code is reloaded, but the state is gone.