Skip to content
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 will make the vue3's watchEffect reload #323

Closed
7 tasks done
dang0705 opened this issue Dec 28, 2023 · 2 comments
Closed
7 tasks done

hmr will make the vue3's watchEffect reload #323

dang0705 opened this issue Dec 28, 2023 · 2 comments

Comments

@dang0705
Copy link

Describe the bug

If you use a variable like flag to control some function run or not in vue3's watchEffect, and trigger the hmr, then it'll make the flag reset in watchEffect, the control will not work any more to the function,and the watchEffect will run without any limitation, you have to refresh the browser to make it normal, How to handle this scnario

Reproduction

https://stackblitz.com/edit/vitejs-vite-fk5fbj?file=main.js&terminal=dev

Steps to reproduce

No response

System Info

System:
    OS: Windows 11 10.0.22635
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
    Memory: 16.34 GB / 31.64 GB
  Binaries:
    Node: 20.10.0 - D:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - D:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (121.0.2277.4), ChromiumDev (121.0.2277.4)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitejs/plugin-vue: ^4.0.0 => 4.2.3
    @vitejs/plugin-vue-jsx: ^3.0.2 => 3.0.2
    vite: ^5.0.2 => 5.0.2

Used Package Manager

npm

Logs

No response

Validations

Copy link

stackblitz bot commented Dec 28, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@sapphi-red sapphi-red transferred this issue from vitejs/vite Dec 30, 2023
Copy link

Hello @dang0705. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants