Skip to content
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

<Transition> with <Suspense> throws <DOMException: Failed to execute 'insertBefore' on 'Node'> when switching components quickly #11806

Closed
b10-as opened this issue Sep 4, 2024 · 1 comment · Fixed by #11818
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working scope: suspense

Comments

@b10-as
Copy link

b10-as commented Sep 4, 2024

Vue version

3.5.0

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-ru5fxj?file=src%2FApp.vue

Steps to reproduce

<template>
  <Transition mode="out-in" name="fade">
    <Suspense>
      <Component :is="Component" />
    </Suspense>
  </Transition>
</template>

Click the button to trigger the error, it quickly switches between the 4 components. First an async component, then a sync component, then a different async component, and finally a different sync component.
This throws the exception: Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

What is expected?

"Sync Component B" should be rendered (after a transition animation)

What is actually happening?

The following error is thrown:

Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

In addition, the content of the Suspense slot is removed and the page remains broken.

System Info

No response

Any additional comments?

It appears to be the same issue as this one: #8105
But more difficult to reproduce because it requires switching between more components

@edison1105
Copy link
Member

edison1105 commented Sep 5, 2024

minimal reproduction with playground

@edison1105 edison1105 added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Sep 5, 2024
yyx990803 pushed a commit that referenced this issue Sep 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working scope: suspense
Projects
None yet
2 participants