New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HMR not working properly when modifying files in node_modules folder #3453
Comments
Please use search before create, answered #3338 |
For |
Hi @alexander-akait, I mentioned in my issue that I already found the #3338 answer but it's not working for me. I tried watchFiles : 'node_modules/**/*', it reloads the page but my components aren't update. (cf. the new video attached) Enregistrement.de.l.ecran.2021-06-18.a.00.58.54.mov |
You need set |
You need set this option here https://github.com/julien-terral/webpack-5-hmr-issue/blob/main/quasar.conf.js#L68, it is not |
Looks A(snapshot, "managedPaths", () => {
return [];
}); all works fine |
Give me couple minutes I will look at workaround for chain-webpack |
I'll try that, thank you for your time you're awesome! |
I confirm that it works like a charm with the fix that you provided me (when I'm update the |
@julien-terral found:
on |
Thank you so much for your time @alexander-akait, it will help me a lot, I was looking for a workaround for days! 🙏 |
@alexander-akait We're using Yarn PnP workspaces with a few packages. We have a No issues with Webpack4 but after the recent upgrade to WP5 changes to the core package stopped being detected from the largest app?! Yup, change detection works fine from smaller apps and it also works fine if I comment out one of the big chunks part of this large app.
I know it would be ideal to have a repro but I hope you see given the "size" factor it's not something easy to do. Could it be related to Yarn somehow? cc @arcanis Thanks! |
Try to set it on |
Just to be clear, you mean that right?
Not working... |
@nkalinov Can you provide small example with steps, no need show code, just example of configuration to reproduce the problem, thanks |
@alexander-akait Thanks for following up!
app1 works but app2 doesn't 😕 Interesting observation 1:
If I comment out half of them, recompilation works! Interesting observation 2: Meanwhile I also tried |
Hi @alexander-akait , I've added a simple Webpack plugin to tap into the watcher-related hooks to dig for more info. There are some weird things going on... All the plugin does is:
Here are the logs: watchRun-working.txt is when it works (by commenting out some of the split chunks), watchRun-broken.txt is when it doesn't work.
|
Another finding:
|
Switched to |
oh, sorry for delay, yes, pnp has problem here, but based on different result on different os, it can be bug in pnp code, do you use the latest version? |
Yes, we are on Yarn 3.2. I can also try the latest master ("from sources") but I don't see anything related to that in their CHANGELOG. Anyways, will report tomorrow. Meanwhile I hope @arcanis would have a minute to give it a thought. |
It's difficult to say since there is no repro. Given that it works with X dependencies but not Y I'd tend to think it doesn't come from either Webpack or Yarn (otherwise I'd expect it to always fail), but that's just a guess 🤔 |
OS: Tried on MacOS, Windows 10, CentOS & Debian10
webpack version: 5.37.1
webpack-dev-server: 4.0.0-beta.3
When I edit my files in the
src
directory, the live reload happens with the latest modifications.However when editing my dependency files (in
node_modules
) for dev purposes, the console warned me that the webpack-dev-server hot reloads but my components don't re-render and all my changes are not taken into account (even if I refresh the whole page). I also tried withnpm link
oryarn link
, but issue was the same.With webpack 4, I never encountered this issue. I was able to change any file in the
node_modules
folder and had hot reload working (without any specific configuration).Code
I've tried to add this config to the devServer options:
and even this one, without success:
This is what's displayed in the console when editing a file in a
node_modules
package (hot reload not working):When editing an
src
file (hot reload working):I thought the issue was related to Quasar, and opened a ticket but it doesn't seem to be the case. One of the creators suggested me to open a ticket here. (Link to the Quasar issue: quasarframework/quasar#9626)
I checked on your GitHub closed issues and found some similar issues but unfortunately none of the answers did the trick for me.
Expected Behavior
When writing a console.log or an alert code in a
node_modules
file, changes are detected and the screen is automatically updated.Actual Behavior
A change is detected and a new build is made, but the console says "[webpack-dev-server] App hot update..."
Also, the screen is not updated.
After ending the process, you must restart it for the changes to take effect.
For Bugs; How can we reproduce the behavior?
Link to the reproducing repo: https://github.com/julien-terral/webpack-5-hmr-issue
Video:
122479919-2a023d80-cfcc-11eb-947e-aa6b85432b79.mov
The text was updated successfully, but these errors were encountered: