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 wrapper components break hydration #3989

Closed
CyberAP opened this issue Jun 21, 2021 · 4 comments
Closed

Transition wrapper components break hydration #3989

CyberAP opened this issue Jun 21, 2021 · 4 comments
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: ssr

Comments

@CyberAP
Copy link
Contributor

CyberAP commented Jun 21, 2021

Version

3.1.1

Reproduction link

https://codesandbox.io/s/goofy-sid-ikmtb?file=/src/App.vue

Steps to reproduce

  1. Create an SSR App with Vue 2 compatibility mode
  2. Add a component that wraps <transition> component
  3. Try to render anything wrapped in that component

What is expected?

Hydration should work without errors

What is actually happening?

Hydration fails with the message:

vue.runtime.esm-bundler.js:1343 [Vue warn]: Hydration node mismatch:
- Client vnode: Symbol(Comment) 
- Server rendered DOM: <!--[--> (start of fragment) 
  at <BaseTransition appear=false persisted=false mode=undefined  ... > 
  at <Transition name="transition-fade" > 
  at <TransitionWrapper> 
  at <App>
@posva posva added 🐞 bug Something isn't working scope: v2 compat labels Jun 22, 2021
@andylizi
Copy link

This is actually unrelated to compat. As far as I can tell, it happens whenever there's a <slot> wrapped in <transition>.

Here's my reproduction using only vue@3.2.4: https://codesandbox.io/s/9mo46?file=/src/App.vue

@209
Copy link

209 commented Oct 23, 2021

No progress on the problem?
I have bug with vue3 and element-plus dropdown. Slot on transition too.

@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed scope: v2 compat labels Oct 25, 2021
@KenCorbettTruepic
Copy link

If you wrap the slot in a div like this it doesn't complain anymore:

<transition>
  <div>
    <slot />
  </div>
</transition>

This feels like a hack but it at least gets rid of the warning.

@LinusBorg LinusBorg changed the title [vue-compat] Transition wrapper components break hydration Transition wrapper components break hydration Dec 8, 2021
@adamcikado
Copy link

Any update on this?

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: ssr
Projects
None yet
Development

No branches or pull requests

8 participants