nuxt: Hot reload is not working
Issue#1: Changes from code editor is not reflecting on the app, Clearing Cache / Reloading the page manually do work.
Issue#2- linked:
When ever there is an exception , say 500 / module not found, after correcting the code, the page don’t reload itself, have to restart server.
Files located inside - pages directory,
System: windows 10,
Nuxi 3.2.0
Nuxt 3.2.0 with Nitro 2.2.1
What i have tried?
- Modified nuxt.config.js as per one of solution
ssr:false,
vite: {
server: {
watch: {
usePolling: true,
},
},
},
Demo:
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 12
- Comments: 43 (5 by maintainers)
I have this issue still. I am using the absolute latest version of both npx nuxi and latest edge nuxt. It fails on both WSL Ubuntu and also on a native ubuntu. This is totally clean and new installations. None of the above solutions have provide any work results.
And it fails right from the start.
I have same issue. HMR works only on client. After some changes in components, the server initially renders the old content. Then client replaces it with updated content.
Nuxt 3.2
I managed to temporarily resolve this by adding
to
nuxt.config.ts.Here you can read some suggestions for the problem https://ahmetonursolmaz.org/nuxt-hot-reload-isnt-working/
Can confirm the same Problem, happened after upgrading to 3.2, 3.0 was working fine
I also have this problem. When saving, the changes are applied only on the client, the old content is displayed on the server.
I tried to install a new project, the result is the same. I’ll try it today on another computer, I’ll write about the results
Still don’t work for me, even via the edge channel
Aha, found that after remove the
.nuxtfolder and restartyarn devthen it work.We’ve just merged a fix for a very similar issue of HMR on Windows. Would anyone experiencing this be happy to test the fix via the edge channel?
I actually already tested the fix via the edge channel and it seems to be working for me. Thanks for the quick resolution of this issue ! 🙏🙏🙏
@manniL Hello Alex,
Yes, it does happen in new project too , initially it will work good, once you start adding components, change in theme - it starts working weird.
Another thing i noticed when there is a v-for , and key is provided, during these scenarios also the changes are not reflecting, when changes are done to to child
Previously while i tried the “experimental nuxt icon” , the preview in the vscode - did work good, but after some time it also stopped working.
@yashinshekh I’m not using Docker. I’m developing on a mac, and in most cases (all now?), hot reload just doesn’t work. Is there a way to log / debug what files are watched for HMR?
For me the problem was fixed by adding port mapping of 24678 in docker-compose.yml
Might be unrelated, but my hot reload issue was fixed by removing the
extractCSSproperty innuxt.configCredit to this reddit post: https://www.reddit.com/r/Nuxt/comments/b7tkbm/disablefix_hot_module_reloading/
I have same issue.
Update from 3.0.0 to 3.2.0 break SSR changes. Everything works on client side but SSR is not reflecting any changes.
Nuxt 3.2.0
EDIT: Same problem with Nuxt 3.1.0
@VladStepanov No, this is not a docker container,
In devtools i’m not getting any logs yet,
unlike nuxt 2 , i’m facing this issue during a fresh installation of nuxt 3.2
To reproduce this issue, can you try changing child of a parent element using v-for loop, check whether all the child reflects same changes , in my case it was reflecting to only one card element ,(reminds me of
<keep-alive/>)@mhdSid If you have an issue with webpack would you open a new issue with a reproduction? 🙏
I did try the edge channel fix and it didn’t work. I suppose I’ll open a new issue…
https://github.com/nuxt/nuxt/issues/18964#issuecomment-1439841687 Did all that changes and still edge channel didnt sort it out
Have a question just to clarify. Is project in docker container? Also provide please logs of devtools console