-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
document new vue 3 page lifecycle behaviour #28182
Comments
|
This is likely not a bug but just how Vue suspense works. Would you see if you can reproduce this in pure Vue SSR without Nuxt (reproduction sandbox)? 🙏 |
Reproduced here: https://stackblitz.com/edit/github-r5rukn?file=src/pages/Home.vue. It is unclear to me if this change is from vue-router 4 or Vue 3. I don't see mention of it in the vue-router 4 migration docs. Does this page lifecycle change warrant mention in the page migration docs? |
Thank you @deleteme. Yes, I would be very happy to document this to help others if you or someone else wanted to raise a PR. 🙏 |
Environment
Reproduction
https://stackblitz.com/edit/github-jks9ab?file=package.json
Easily reproducible with two pages that log the
mounted
,beforeUnmount
, andunmounted
lifecycle methods.Describe the bug
When navigating between pages, the previous page component exists longer than expected, after the new one is mounted.
This problem doesn't exist In Nuxt 2. The previous page
destroyed
lifecycle method (the equivalent of Vue 3'sunmounted
), is called before the new page mounts.Additional context
This bug impacts
@vue/apollo-option
package, which relies upon theunmounted
lifecycle method to perform cleanup operations. A consequence of this bug is that bad GraphQL requests can happen from a page that should already be unmounted.Previously reported here #13879.
Logs
No response
The text was updated successfully, but these errors were encountered: