-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Error page lost pinia state #14968
Comments
I think you will have to use local storage to persist state on client side. Maybe this package will help https://github.com/prazdevs/pinia-plugin-persistedstate |
Would you provide a reproduction? 🙏 |
If you get error-page while ssr, you lost all your headers and also cookie, mb it help with it #14842 |
https://stackblitz.com/edit/github-7egzqc?file=middleware/global.global.ts |
Thank you. Yes, I think this is the same issue as #14842. Error pages are meant to be cacheable so they are rendered in a separate, internal request without the original request headers. And in general, they need to handle unforeseen errors, so I would suggest making them as free of dependencies on other parts of your app as possible. |
Environment
"nuxt": "3.0.0-rc.10",
"@pinia/nuxt": "^0.4.2",
Reproduction
"nuxt": "3.0.0-rc.10",
"@pinia/nuxt": "^0.4.2",
Describe the bug
I get global data in app.vue, verify user in middleware global.global and save them in pinia (for example get token in cookie and save in pinia);
When I get to an error page and try to refresh it with keyboard F5;
At this time I click the back to home button on the page, pinia will disappear,
All state data will be lost;
They work fine if I don't refresh the error page;
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: