-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Updating @rails/webpacker from 4.0.7 to 4.1.0+ breaks hmr #2427
Comments
For anyone else, here is the diff between the versions: v4.0.7...v4.1.0 After reviewing everything, I think the issue stems from #2242 since webpacker/package/environments/development.js Lines 10 to 13 in ce9c210
Under
|
Here you go:
|
How do you run the dev server in relation to this part of the readme? e.g.: Edit: Can you also tell me what your console output is as the page reloads? It should be printing info on what chunk failed and caused a full refresh. Be sure to preserve the log (Chrome): |
@jakeNiemiec I'm running my app in docker containers, running |
I cleared my console, ensured log is preserved and made a change to a |
I am not experienced enough with docker to know if having them in separate containers would break things. It looks like the script inserted in the page can't get a response WDS. You could take a look in the network tab to see what frames are being sent over the websocket. I know that Webpacker uses proxies & forwarding for WDS, that might help you configure docker. I can only point you to Webpacker's Docker docs at this point. I hope you can get it working. |
I don't think that separate container makes any difference here - websocket connections are connecting directly to the WDS and I am still using the Rails proxy for fetching the assets. Everything was working correctly with webpacker
I'm seeing these lines at the beginning of each page load, even when HMR is working correctly. I looked into the Network tab and this is what I see: 👆page load 👆after making a change in I thought that these |
If you could point me to how debug this hrm, I'll be happy to dig deeper. |
Take a look at #2165 (comment) You could look at the changes he had to implement to upgrade to From where I am standing I can't see anything wrong with the stuff you posted. Sorry I can't be of more help. |
@majkelcc can you give me a simple github repo that reproduces the issue? |
I'll try to build a demo app next week. |
@justin808 @jakeNiemiec I was able to reproduce this on a clean rails app: https://github.com/majkelcc/webpacker_issue_2427. I updated webpacker |
@jakeNiemiec good news! I tried updating webpacker to the latest When I downgraded It looks like there's something wrong in the way it works now and a new API will be introduced for Webpack 5. Do you think this deserves a not in |
Feel free to reopen this issue here: |
👋
After updating
@rails/webpacker
from4.0.7
to4.1.0
, hmr is no longer working - changingscss
file results in a full page reload. I didn't make any changes to my configuration files.When I only update the gem and keep npm package at
4.0.7
, hmr is still working. I also tried the latest4.2.2
version of npm package, which also breaks hmr in my application.The text was updated successfully, but these errors were encountered: