-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Pinia store reactivity breaks with vue-router on some cases #2778
Comments
Hi, I have the same issue, and it started with Vue 3.5.7. With Vue 3.5.6 the Pinia getters it's working fine. |
If this happens after 3.5.6, it's likely a bug in Vue, not specific to pinia (or router). I would recommend trying to reproduce it without the router first, using pinia playground and try to recreate it with When looking at the changelog and other issues, I see that the behavior is similar to vuejs/core#12033 |
Thank you for the input. The referenced core repo issue does indeed seems similar. Unfortunately, I won’t have the time to create another reproduction of the issue myself. However, based on my tests, I can confirm that the bug appears after Vue version 3.5.6 (so in 3.5.7). If someone else has the bandwidth to try reproducing it in a Pinia playground without Pinia and the router, that would be great. |
A couple of bugs related to |
Just tested and it works again 🎉 |
Reproduction
https://stackblitz.com/edit/vitejs-vite-ci1v82?file=src%2Fstore.ts
Steps to reproduce the bug
I tried to reproduce the bug on StackBlitz.
The example app:
The top component has router-view and links to 3 different pages:
Steps to reproduce the bug:
Expected behavior
Getter value from the store should update and show the cumulative experience of the User objects on the Home page
Actual behavior
Getter value doesn't update on the Home page
Additional information
If you remove the
{ path: '/state', component: HelloWorld },
from the routes array in router.ts, the getter works as expectedAlso: On the production app where I first noticed this, enabling Vue DevTools in prod with
__VUE_PROD_DEVTOOLS__: true,
the issue was fixed. This didn't reproduce in StackBlitz example.The text was updated successfully, but these errors were encountered: