You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suspense unmounts with an error if it renders a component with a root node implementing a client-only behavior #12920
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problemscope: suspense
The Suspense component unmounts, but the app crashes - the error pops up and the toggle button no longer works.
System Info
Any additional comments?
I was trying to implement a loader for async components with some reload logic (retries, reload when connection is restored - things like that). And one of the components had a client-only logic in it: it was rendering the actual content only after the mounted hook. I didn't use the errorComponent/onError from the AsyncComponentOptions because i needed to reload the component again, so i used Suspense and its fallback slot.
I understand that Suspense is experimental and i have been able to resolve this issue in my project by wrapping the template of the async component in a static div, but the issue itself is there.
FYI - it's very easy to hit this problem with inertia. Put a <Suspense> in your layout, and your app will crash with Unhandled error during execution of component update and Failed to execute 'insertBefore' on 'Node'. Only when visiting non-async inertia pages.
Just add the magic <div> wrapper as a workaround. Thanks all, we love vue
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problemscope: suspense
Activity
edison1105 commentedon Feb 20, 2025
a workaround
see playground
gurgeous commentedon May 22, 2025
FYI - it's very easy to hit this problem with inertia. Put a
<Suspense>in your layout, and your app will crash withUnhandled error during execution of component updateandFailed to execute 'insertBefore' on 'Node'. Only when visiting non-async inertia pages.Just add the magic
<div>wrapper as a workaround. Thanks all, we love vuefix(suspense): update suspense vnode's el during branch self-update (#…