Skip to content

[Vue warn]: <TransitionGroup> children must be keyed. With whitespace = 'preserve' #11885

@LeftGamer1

Description

@LeftGamer1

Vue version

3.5.4

Link to minimal reproduction

https://codesandbox.io/p/sandbox/vue3-transition-group-with-whitespace-preserve-chg4p8?file=%2Fsrc%2FApp.js

Steps to reproduce

  1. open devtools console
  2. click 'toggle' button (optional tbh)

What is expected?

No whitespace node when markdown tags with newlines

What is actually happening?

Console spamming with [Vue warn]: <TransitionGroup> children must be keyed because of whitespace node (generated from newline)

System Info

No response

Any additional comments?

Also on sandbox i have commented working variation.
Also2 there is no issue when using Vue2, i know that since i am working on migrating my repo.

Link that i provided was for a .js template option without Vite;
I also have a link for a case with Vite and tag: https://codesandbox.io/p/devbox/jolly-ives-l6jfvx

Also there is console.log of slot, in working variation without newlines - there is only 2 nodes, and with newlines - 3 nodes (where one of them has children: ' '

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions