Subscribe on changes!

SSR teleports don't work with Suspense

avatar
Jun 30th 2022

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/github-kqkhhq

Steps to reproduce

The following code is sufficient to reproduce the bug:

<Teleport to="#async">
  <Suspense>
    <SomeAsyncComponent />
  </Suspense>
</Teleport>

In the reproduction sandbox, you can see that on client-side this behaves correctly (and would hydrate HTML that rendered correctly), and also that this behaves fine on SSR with a sync component.

Note that the same behaviour is displayed if suspense is lifted higher (some nodes higher than teleport) or is nested deeper within the teleport.

What is expected?

It's expected that the async component will render into the teleport on SSR.

What is actually happening?

Instead, all that is rendered is the teleport anchor.

System Info

Stackblitz.

Any additional comments?

No response