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 does not pick up updates to data #12822
Comments
I have the same issue - using
Behavior is the same as described by @radusuciu - updating template works immediately, but whenever I change |
Thanks for the validation, was feeling a little crazy that I was the only one with the issue despite my being able to reproduce it consistently.. in fact I can't NOT reproduce it 🤣 |
I can't reproduce this. Are you still experiencing it? |
I still can reproduce, here's a smallest repo with reproduction (includes brief instructions in Readme). |
Oh, I believe you, even without the video proof! 😉 What is your full directory name on the Ubuntu box? If there's any way you can confirm other dependencies are the same, such as node & package manager version, that would be great. However, my instinct is that this might be a watcher issue. Are you getting any notification in your browser that a HMR has taken place? |
No chance you have any service workers running? Could you try a different browser or an incognito window? |
I tried running in different browser/incognito - still reproducible.
line in the hot reload script above (line 32 on screenshot above). I've found where this line is added in @vitejs/plugin-vue:
I added logging inside I added the same log on my MacOs box and the script content is different (as it should be) on each update. |
Ok, @danielroe, your instinct was right after all:
I kept digging inside @vitejs/plugin-vue and found out that if I add a 100ms sleep inside
After I set |
Great debugging - thank you for all your hard work! I wonder if there is any environment cue that we can pick up on to enable this by default on affected environments... Or add it to the docs 🤔 |
I don't know, TBH. Pure vite solution works as expected, without explicitly setting the |
Same problem here (on Windows), your solution solves the problem , thx |
Encountered same issue (I'm on WSL2 but my code is on the Subsystem), fixed with Reproduction<script setup>
const data = ref('a')
</script>
<template>
<div>
{{ data }}
</div>
</template> Then changes On my computer, it won't correctly trigger HMR client side. |
Thanks for sharing reproductions. I can confirm the same issue on WSL2 and also normal Linux servers and windows. HMR only works fine on a macOS laptop with fsevents.
An interesting finding is that native watcher, works but only for one instance. Disabling server [watcher] with |
Hi, sorry for abandoning issue there but I haven't used nuxt since this (partly because of this bug and partly because I wanted to stick with just I wouldn't consider |
As an alternative of # Workaround for Chokidar Watcher
export CHOKIDAR_USEPOLLING=1 This will do the same but be applied for every project through this environment variable. This can be suitable until we find a better solution to this issue. |
I am also experiencing the same problem on
|
i run into the same issue. i have this simple Vue Component
if i change foo, HMR will not update the browser.
|
I have the same issue. I have tailwind installed with nuxt3 app. When i change the class of any html element, the hmr will not update the browser. Until i restart server. My nuxtconfig is: Can someone help please ? |
Is this still an issue with current stable nuxt releases? Or can it be closed? |
I just verified that this is fixed with the latest version of nuxt! Thank you! |
Environment
Running on WSL but have had the same issue in a containerized application..
Tested in latest Firefox and Chrome with identical results.
Nuxt CLI v3.0.0-27288761.d3fb512
RootDir: ...
Nuxt project info:
Linux
v16.13.0
3.0.0-27288761.d3fb512
yarn@1.22.17
Vite
-
-
-
Reproduction
https://github.com/radusuciu/nuxt3-app
Describe the bug
Updated data is not picked up by HMR. Updating the template is. Data updates are reflected after a full refresh only.
Potentially related to #11956 but I don't see any errors and it isn't sporadic - it just doesn't work even though Vite does seem to pick up the updates judging by the "Vite server built in XXms" logs messages and "[vite] hot updated: /app.vue" output in the console.
Additional context
I have no issues with HMR in nuxt2, nor if I use vite by itself.
Logs
No response
The text was updated successfully, but these errors were encountered: