HMR not working on webpack 5.66.0
See original GitHub issueBug report
What is the current behavior? Hot module reloading is not working after updating webpack to v5.66.0.
If the current behavior is a bug, please provide the steps to reproduce.
- Clone https://github.com/saltire/react-node-boilerplate.
- Run
npm i webpack@latest
to update to 5.66.0. - Run
npm run watch
. - Modify
src/App.jsx
. The browser console reportsbundle rebuilding
twice, the request tomain.xxxxx.hot-update.json
fails with status 404, and the app does not update.
Notice the issue does not occur if webpack 5.65.0 is installed.
What is the expected behavior? When making a change to a jsx file, the app should reload automatically.
Other relevant information: webpack version: 5.66.0 Node.js version: 16 Operating System: MacOS Additional tools
This repo uses webpack-dev-middleware
, webpack-hot-middleware
, react-refresh
, and @pmmmwh/react-refresh-webpack-plugin
, among other packages. The issue may stem from a conflict with one of these, but I don’t have enough internal knowledge of webpack or these packages to say which. It could also be a misconfiguration on my part. I’m filing the issue with webpack
because I was able to isolate the problem to an update of this package.
Let me know if you need any more info!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:10
- Comments:34 (19 by maintainers)
Top GitHub Comments
no work in v 5.72.1
@alexander-akait yeah, that’s what I think as well, we’ve been seeing double bundling on our side - though often times, the hash doesn’t change, but the files are deleted from the output directory. I’m trying to bisect when this started happening, I’ll post my results here shortly
Update: it’s starting from
5.66.0
- any prior version I tried (5.65.0
,5.64.4
,5.62.0
,5.64.0
,5.62.0
) works as expected.