browser: Chrome Version 74.0.3729.131 (Official Build) (64-bit)
[x] This is a bug
// webpack.config.js
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 9000,
compress: true,
hot: true,
overlay: true,
inline: true
}
HMR updates page without full reload
When I run webpack-dev-server --mode development --hot --inline any .js file change shows the following in the console:
[HMR] Cannot apply update. Need to do a full reload!
Error: Aborted because {file} is not accepted
Update propagation {file} -> 0
and then the whole page is reloaded losing state.
Changing CSS file works without any issue.
Run webpack-dev-server and change any *.js file.
Please create minimum reproducible test repo
Why you use inline?
repo:
https://github.com/fret2buzz/webpack-dev
Why you use inline?
to see build messages in the browser console
You don't need inline to see build messages in the browser console
It is expected, your code doesn't have hmr logic, please read https://webpack.js.org/concepts/hot-module-replacement/ , if you use react you can use react-hot-loader (https://github.com/gaearon/react-hot-loader), for vue https://vue-loader.vuejs.org/guide/hot-reload.html, if you have own code please read article https://webpack.js.org/guides/hot-module-replacement/
Most helpful comment
It is expected, your code doesn't have hmr logic, please read https://webpack.js.org/concepts/hot-module-replacement/ , if you use react you can use react-hot-loader (https://github.com/gaearon/react-hot-loader), for vue https://vue-loader.vuejs.org/guide/hot-reload.html, if you have own code please read article https://webpack.js.org/guides/hot-module-replacement/