-
-
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
fix(nuxt): fix error on layout switching #21450
Conversation
/trigger release |
π Release triggered! You can now install nuxt@npm:nuxt3@pr-21450 |
I think we should inject |
This is not merged because it does break some other things (not just transitions). But we'll merge ASAP as soon as we can, and release in a patch. |
Ok thanks for replying! |
/trigger release |
π Release triggered! You can now install nuxt@npm:nuxt3@pr-21450 |
@antfu is not ready for review, it does not fix all the linked issues ;-( |
#21701 should work on my opinion for major releases. if you having a guard middleware like auth protecting page resources it should work as expected, or am i wrong? |
@c-schwan This PR fixes that issue, in my testing. |
Nuxt 3.6.0-28124217.43844474 (npm:nuxt3@pr-21450) https://stackblitz.com/edit/middleware-nuxt but still not working |
Have you tried it locally? |
i tried locally with the stackblitz project and locally in our project, both no luck |
it works well on the first time switching the layout but going back (Browser or via NuxtLink) it won't be called anymore |
π Linked issue
fix #13309
resolves #21544
resolves #21534
β Type of change
π Description
I am not 100% sure, but it fixes the error in this reproduction: #13309 (comment)
From what I see, is that our
LayoutLoader
is an async component that has a unique key. When the layout gets changed, a newLayoutLoader
is created. Because Vue's suspense can not catch async patches on deep branches (an known issue), causing it to have a DOM that is already dismissed.The solution to solve that is to wrap it with a suspensible Suspense to capture the update properly.
π Checklist