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

Suspense incorrectly warns that it supports single root node only #4016

Closed
jods4 opened this issue Jun 28, 2021 · 3 comments
Closed

Suspense incorrectly warns that it supports single root node only #4016

jods4 opened this issue Jun 28, 2021 · 3 comments

Comments

@jods4
Copy link
Contributor

jods4 commented Jun 28, 2021

Version

3.1.2

Reproduction link

https://codesandbox.io/s/agitated-saha-hu5uf?file=/src/App.vue

Steps to reproduce

The linked repro is a very basic router suspense component:is setup, like so:

  <router-view v-slot="{ Component }">
    <suspense>
      <component :is="Component" />
    </suspense>
  </router-view>

Look at the CodeSandbox console.

What is expected?

No warning.

What is actually happening?

It warns "<Suspense> slots expect a single root node."


I have debugged into filterSingleRoot(children).

It seems the children array (after slot invocation) contains a single item representing <Component :is> (that's expected).
For a reason unknown to me, at this point this vnode is a comment; and comments other than v-if are ignored by filterSingleRoot.

@posva
Copy link
Member

posva commented Jun 28, 2021

Duplicate of #3962

@posva posva marked this as a duplicate of #3962 Jun 28, 2021
@posva posva closed this as completed Jun 28, 2021
@jods4
Copy link
Contributor Author

jods4 commented Jun 29, 2021

Sorry I did not find the duplicate (#3692 is a PR not an issue).
Glad it's already fixed!

@ruchenshanghai

This comment has been minimized.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants