webpack: "Cannot read property 'harmonyModule' of null" in watch mode
Happens with 2.2.0-rc.0 while running in watch mode / webpack-dev-server under unknown conditions after editing a file. After it occurs, re-editing and saving the file, or a dependency, or a parent does not help. Restarting the webpack-dev-server builds successfully.
ERROR in ./src/api/notifications/helpers.ts
Module parse failed: .../node_modules/awesome-typescript-loader/dist/entry.js?{"configFileName":".../src/tsconfig.json","useBabel":true,"sourceMap":true,"verbose":false}!.../src/api/notifications/helpers.ts Cannot read property 'harmonyModule' of null
You may need an appropriate loader to handle this file type.
TypeError: Cannot read property 'harmonyModule' of null
at makeHarmonyModule (.../node_modules/webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js:14:17)
at Parser.import (.../node_modules/webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js:25:3)
at Parser.applyPluginsBailResult (.../node_modules/tapable/lib/Tapable.js:73:27)
at Parser.walkImportDeclaration (.../node_modules/webpack/lib/Parser.js:547:7)
at Parser.walkStatement (.../node_modules/webpack/lib/Parser.js:432:32)
at Parser.<anonymous> (.../node_modules/webpack/lib/Parser.js:413:9)
at Array.forEach (native)
at Parser.walkStatements (.../node_modules/webpack/lib/Parser.js:411:13)
at Parser.parse (.../node_modules/webpack/lib/Parser.js:1142:8)
at .../node_modules/webpack/lib/NormalModule.js:199:17
at .../node_modules/webpack/lib/NormalModule.js:164:10
at .../node_modules/loader-runner/lib/LoaderRunner.js:365:3
at iterateNormalLoaders (.../node_modules/loader-runner/lib/LoaderRunner.js:206:10)
at iterateNormalLoaders (.../node_modules/loader-runner/lib/LoaderRunner.js:213:10)
at .../loader-runner/lib/LoaderRunner.js:228:3
at context.callback (.../node_modules/loader-runner/lib/LoaderRunner.js:106:13)
@ ./src/api/notifications/index.ts 3:0-48
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 43
- Comments: 26 (7 by maintainers)
Commits related to this issue
- fix: webpack https://github.com/webpack/webpack/issues/3498 — committed to gaowhen/gon by gaowhen 7 years ago
- Merge pull request #32 from gaowhen/antd fix: webpack https://github.com/webpack/webpack/issues/3498 — committed to gaowhen/gon by gaowhen 7 years ago
this is maybe fixed by: https://github.com/webpack/webpack/commit/862478e3b4956caa10527d760baf775c2d2f79b2
I seem to get it every time it recompiles code with syntax errors.
@TheLarkInn it indeed does still happen with 2.2.0-rc.1
can confirm, work as expected with
2.2.0-rc.2
👍🏻Same here. After corrected a syntax error, I always get this error.