Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TransitionGroup hydration mismatch (caused by comment) #11958

Closed
fabkho opened this issue Sep 18, 2024 · 1 comment · Fixed by #11961
Closed

TransitionGroup hydration mismatch (caused by comment) #11958

fabkho opened this issue Sep 18, 2024 · 1 comment · Fixed by #11961
Labels
🐞 bug Something isn't working scope: transition

Comments

@fabkho
Copy link

fabkho commented Sep 18, 2024

Vue version

3.5.x

Link to minimal reproduction

https://stackblitz.com/edit/vue-ssr-example-9tg6p3?file=app.js

Steps to reproduce

Steps to Reproduce

  1. Create a server-side rendered app.
  2. Use TransitionGroup.
  3. Include a comment inside the TransitionGroup.

Describe the Bug
A hydration mismatch occurs inside a TransitionGroup when a comment is present.

[Vue warn]: Hydration children mismatch on <div>​…​</div>​ 
Server rendered element contains more child nodes than client vdom. 
  at <TransitionGroup tag="div" > 
  at <App>

Code Example

<div>
  <transition-group tag="div">
    <div v-for="(item, index) in data" :key="item.id">
      {{ item.name }}
    </div>
    <!--test-->
    <div v-if="false" :key="3"></div>
  </transition-group>
</div>

What is expected?

No hydration error

What is actually happening?

A hydration error

System Info

System:
    OS: macOS 14.3.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 1.96 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 9.0.6 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 127.0.6533.89
    Safari: 17.3.1

Any additional comments?

Related Nuxt issue: #28381

@edison1105 edison1105 added 🐞 bug Something isn't working scope: transition labels Sep 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2024
abdullah-wn pushed a commit to Lazy-work/vue that referenced this issue Jan 4, 2025
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
🐞 bug Something isn't working scope: transition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@edison1105 @fabkho and others