Closed glen-84 closed 5 years ago
I don't think this is the right repo for this issue.
The webpack plugin does nothing related to HMR. It only manipulates the dependency graph to ensure:
ModuleConcatenationPlugin
and co.;So in the end it's just a bunch of dependencies that you might have built manually with tons of per-module configuration.
You might want to move this issue to aurelia/loader-webpack
, which is the runtime piece and it contains bits related to HMR.
I have zero knowledge of the HMR aspects of our Webpack loader, so hopefully someone else might be able to help.
I don't think this is the right repo for this issue.
My apologies.
You might want to move this issue to
aurelia/loader-webpack
, which is the runtime piece ...
It's a build-time error, so I'll assume that it's also not the cause.
I don't think this is the right repo for this issue.
My apologies.
Don't worry, no problem. There are many repos in Aurelia, three just for Webpack (incl. an obsolete one). Sometimes it's can be tricky to find the right repo for a specific issue without knowing Aurelia internals.
It's a build-time error, so I'll assume that it's also not the cause.
Sorry, my bad. I read too fast and I thought this was an exception at runtime, when using HMR.
If I understand correctly, Node fails to find normalize-url
, which is required by mini-css-extract-plugin
.
This is really strange since normalize-url
is declared as a dependency:
https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/package.json#L44
Do you think I should re-open the issue? This seems like a Node module resolution problem (so npm, yarn and co.) and I have no idea how/why this package might influence this.
If you find that webpack-plugin
is involved in the problem in any way I'll gladly fix it.
This seems to have just stopped happening in the repro project. 😕
I'm going to try it again in our real project, and see what happens.
Can't say it's the first time deleting node_modules
, followed by npm install
resolves issues 😞
Please ignore my last comment – I accidentally used npm run build
instead of npm start
, which is where the issue is (still) happening. 🤦♂
I can swear that I deleted node_modules
and package-lock.json
yesterday, and it didn't work. I just did it again now (along with npm cache clear --force
), and now it's working! 🎉
(sorry about the false alarm)
I'm submitting a bug report
Please tell us about your environment:
Operating System: Windows 10
Node Version: v10.15.3
NPM Version: 6.4.1
JSPM OR Webpack AND Version webpack 4.30.0
Browser: all
Language: TypeScript 3.4.5
Current behavior:
This error with CSS HMR enabled:
https://github.com/glen-84/css-hmr-issue (
npm i
,npm start
)(this is a copy of our project that I reduced from ~571 files to 31)
Change
hmr: isHot
tohmr: false
(twice), and the error will go away.I did not see this error with
mini-css-extract-plugin
0.5.0 +css-hot-loader
.Expected/desired behavior:
No error.
n/a
See also: https://github.com/webpack-contrib/mini-css-extract-plugin/issues/387