webpack-dev-server: HMR appears broken in 3.4.1 upgrading from 3.3.1
- Operating System: W10
- Node Version: 1.15.3
- yarnVersion: 1.15.2
- webpack Version: 4.32.1
- webpack-dev-server Version: 3.4.1
- [x ] This is a bug
- This is a modification request
Code
// webpack.config.js
// additional code, remove if not needed.
Expected Behavior
HRM is working.
[WDS] App updated. Recompiling...
client:146 [WDS] 0% - compiling.
2client:146 [WDS] 10% - building (0/0 modules).
client:146 [WDS] 10% - building (0/1 modules).
client:146 [WDS] 10% - building (0/2 modules).
client:146 [WDS] 40% - building (0/2 modules).
client:146 [WDS] 40% - building (1/2 modules).
client:146 [WDS] 40% - building (1/3 modules).
client:146 [WDS] 40% - building (1/4 modules).
client:146 [WDS] 40% - building (1/5 modules).
client:146 [WDS] 40% - building (2/5 modules).
client:146 [WDS] 40% - building (2/6 modules).
client:146 [WDS] 40% - building (3/6 modules).
client:146 [WDS] 40% - building (4/6 modules).
client:146 [WDS] 40% - building (5/6 modules).
client:146 [WDS] 40% - building (6/6 modules).
client:146 [WDS] 70% - building (6/6 modules).
client:146 [WDS] 70% - finish module graph.
client:146 [WDS] 70% - finish module graph (FlagDependencyExportsPlugin).
client:146 [WDS] 70% - sealing.
client:146 [WDS] 70% - sealing (WarnCaseSensitiveModulesPlugin).
client:146 [WDS] 71% - basic dependencies optimization.
client:146 [WDS] 72% - dependencies optimization.
client:146 [WDS] 72% - advanced dependencies optimization.
client:146 [WDS] 73% - after dependencies optimization.
client:146 [WDS] 70% - chunk graph.
client:146 [WDS] 71% - after chunk graph.
client:146 [WDS] 71% - after chunk graph (WebAssemblyModulesPlugin).
client:146 [WDS] 73% - optimizing.
client:146 [WDS] 74% - basic module optimization.
client:146 [WDS] 74% - module optimization.
client:146 [WDS] 75% - advanced module optimization.
client:146 [WDS] 75% - after module optimization.
client:146 [WDS] 76% - basic chunk optimization.
client:146 [WDS] 76% - basic chunk optimization (EnsureChunkConditionsPlugin).
client:146 [WDS] 76% - basic chunk optimization (RemoveParentModulesPlugin).
client:146 [WDS] 76% - basic chunk optimization (RemoveEmptyChunksPlugin).
client:146 [WDS] 76% - basic chunk optimization (MergeDuplicateChunksPlugin).
client:146 [WDS] 76% - chunk optimization.
client:146 [WDS] 77% - advanced chunk optimization.
client:146 [WDS] 77% - advanced chunk optimization (SplitChunksPlugin).
client:146 [WDS] 77% - advanced chunk optimization (RemoveEmptyChunksPlugin).
client:146 [WDS] 77% - after chunk optimization.
client:146 [WDS] 78% - module and chunk tree optimization.
client:146 [WDS] 78% - after module and chunk tree optimization.
client:146 [WDS] 79% - basic chunk modules optimization.
client:146 [WDS] 79% - chunk modules optimization.
client:146 [WDS] 80% - advanced chunk modules optimization.
client:146 [WDS] 80% - after chunk modules optimization.
client:146 [WDS] 81% - module reviving.
client:146 [WDS] 81% - module reviving (RecordIdsPlugin).
client:146 [WDS] 81% - module order optimization.
client:146 [WDS] 82% - advanced module order optimization.
client:146 [WDS] 82% - before module ids.
client:146 [WDS] 82% - before module ids (NamedModulesPlugin).
client:146 [WDS] 83% - module ids.
client:146 [WDS] 83% - module id optimization.
client:146 [WDS] 84% - module id optimization.
client:146 [WDS] 84% - chunk reviving.
client:146 [WDS] 84% - chunk reviving (RecordIdsPlugin).
client:146 [WDS] 85% - chunk order optimization.
client:146 [WDS] 85% - chunk order optimization (OccurrenceOrderChunkIdsPlugin).
client:146 [WDS] 85% - before chunk ids.
client:146 [WDS] 85% - before chunk ids (NamedChunksPlugin).
client:146 [WDS] 86% - chunk id optimization.
client:146 [WDS] 86% - after chunk id optimization.
client:146 [WDS] 87% - record modules.
client:146 [WDS] 87% - record modules (RecordIdsPlugin).
client:146 [WDS] 87% - record chunks.
client:146 [WDS] 87% - record chunks (RecordIdsPlugin).
client:146 [WDS] 88% - hashing.
client:146 [WDS] 88% - content hashing.
client:146 [WDS] 88% - content hashing (JavascriptModulesPlugin).
client:146 [WDS] 89% - after hashing.
client:146 [WDS] 89% - after hashing (HotModuleReplacementPlugin).
client:146 [WDS] 89% - record hash.
client:146 [WDS] 90% - module assets processing.
client:146 [WDS] 90% - chunk assets processing.
client:146 [WDS] 91% - additional chunk assets processing.
client:146 [WDS] 91% - additional chunk assets processing (HotModuleReplacementPlugin).
client:146 [WDS] 91% - recording.
client:146 [WDS] 91% - recording (HotModuleReplacementPlugin).
client:146 [WDS] 92% - additional asset processing.
client:146 [WDS] 92% - chunk asset optimization.
client:146 [WDS] 93% - after chunk asset optimization.
client:146 [WDS] 93% - asset optimization.
client:146 [WDS] 94% - after asset optimization.
client:146 [WDS] 94% - after seal.
client:146 [WDS] 95% - emitting.
client:146 [WDS] 95% - emitting (HtmlWebpackPlugin).
client:146 [WDS] 98% - after emitting.
client:146 [WDS] 100% - Compilation completed.
client:170 [WDS] Warnings while compiling.
warnings @ client:170
onmessage @ socket.js:40
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:887
SockJS._transportMessage @ sockjs.js:885
EventEmitter.emit @ sockjs.js:86
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:887
SockJS._transportMessage @ sockjs.js:885
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2961
client:265 [WDS] App hot update...
log.js:24 [HMR] Checking for updates on the server...
log.js:24 [HMR] Updated modules:
log.js:16 [HMR] - ./src/app/components/header/header.scss
log.js:24 [HMR] App is up to date.
Actual Behavior
HRM is not working.
[HMR] Waiting for update signal from WDS...
... application logging follows
No updates, no WDS messages, whatsoever.
For Bugs; How can we reproduce the behavior?
Due to the nature of the project I’m working on I cannot share actual code, however. I’m experiencing a regression by upgrading from “webpack-dev-server”: “3.3.1”, to “webpack-dev-server”: “^3.4.1”,
I’m not the only one who is experiencing this. https://github.com/webpack/webpack-dev-server/issues/1897#issuecomment-493931508 But it was dismissed in that thread.
Our current workaround is to keep 3.3.1 pinned until this is resolved.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 7
- Comments: 41 (27 by maintainers)
What i meant was, that configuring
watchOptions: { ignored: ['node_modules', '!node_modules/my_module'] }
solved the issue for me 😃Sorry for that, my mistake 😉
Even setting the target to web, adding injectHot / injectClient options to true doesn’t make HMR work on 3.4 for me…, please re-open
– EDIT –
Scrap that, I forgot to re-npm-link my stuff, so I wasn’t checking it correctly, works now with web target
@ezze
watchOptions: { ignored: ['node_modules', '!node_modules/my_module'] }
in theory should be work, but need tests@ezze don’t forget watching
node_modules
can overload your machine@ezze hot !== watch, we ignore
node_modules
by default, you can solve problem using https://github.com/webpack/webpack-dev-server/issues/1913