You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hot Module Replacement not working when target is set to ['web', 'es5'] #2961
Page should reload when files are changed.
HMR should connect via websocket
Actual Behavior
Not reloading. No message in the console either.
It seems websocket is not connected? I checked the Network - WS panel in Chrome devtools.
For Bugs; How can we reproduce the behavior?
When I use target: ['web', 'es5'], HMR doesn't seem to work. When I open the page I can see a [HMR] Waiting for update signal from WDS... message but there is no second "[WDS] ..." (HMR enabled confirmation message). When I check the Networks tab in devtools, there are no WS connections.
Curiously, when I change target: 'web' in the same config file - HMR works fine.
I have a couple of devServer configs that are no longer supported in v4.
What do you mean? How you run webpack-dev-server in this case?
Eh, I just looked at the errors and took some guesses. BTW I'm running the server with the JS API not CLI.
e.g. I'm getting _webpackDevServer.default.addDevServerEntrypoints is not a function and various errors like configuration has an unknown property 'stats' - I removed some non-essential ones (e.g. clientLogLevel) and tweaked the rest to get it to run - maybe that's where I messed things up?
Activity
alexander-akait commentedon Jan 12, 2021
Yes, it is fixed in webpack-dev-server@4-beta.0
pallymore commentedon Jan 12, 2021
thanks @alexander-akait
I tried it yesterday but it wasn't working either. Maybe I missed something, but I can try it again today 🤔
Is there a (draft) migration guide? I have a couple of devServer configs that are no longer supported in v4.
alexander-akait commentedon Jan 12, 2021
What do you mean? How you run webpack-dev-server in this case?
pallymore commentedon Jan 12, 2021
Eh, I just looked at the errors and took some guesses. BTW I'm running the server with the JS API not CLI.
e.g. I'm getting
_webpackDevServer.default.addDevServerEntrypoints is not a functionand various errors likeconfiguration has an unknown property 'stats'- I removed some non-essential ones (e.g.clientLogLevel) and tweaked the rest to get it to run - maybe that's where I messed things up?alexander-akait commentedon Jan 12, 2021
_webpackDevServer.default.addDevServerEntrypoints is not a functionbecausedefaultdoesn't exists, we don't useimportorexportPlease read changelog many options were removed and it was described
pallymore commentedon Jan 12, 2021
Thanks - somehow I missed it earlier. 😅
I fixed the config and HMR is working as intended. Thanks for your help!