-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
watchEffect within effectScope()
stops working after navigating away from then back to component
#7606
Comments
effectScope()
stops working after navigating away from then back to component
Trasfered from pinia and updated the reproduction. |
I cannot use a regular watch, as I mentioned the sample code above is an inlined version of VueUse:computedAsync. Here is the original store:
|
The linked issue put me on the right track, calling useXxxStore from main.js before the Vue app is mounted is a valid workaround, watchEffect gets called with currentInstance = null and the effect works normally. |
I think the root cause is exactly the same and @LinusBorg 's PR will fix this. see |
hmm, maybe something after cd7c887 broke this then? because it fails on the latest commit on the main branch |
Now I see that the import maps were version-fixed and had the wrong version of Vue 🥲 |
Reproduction
Playground SFC
Steps to reproduce the bug
Expected behavior
The button should cause testData.count to be incremented, even after re-mounting the component.
Actual behavior
After navigating back to the component clicking the button updates the refresher, but not testData
The text was updated successfully, but these errors were encountered: