question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hydration Error at use teleport

See original GitHub issue

Environment

  • node: LTS
  • nuxt: latest

Reproduction

https://codesandbox.io/s/nuxt3-teleport-bug-6b2vr

Describe the bug

Hello 😀

Hydration error occurs when using teleport in nuxt3. I inserted a teleport target in app.vue and it works normally until code movement. However, since hydration mismatch occurs, the function of the code to be teleported cannot operate normally.

Additional context

No response

Logs

[Vue warn]: Hydration children mismatch in <div>: server rendered element contains fewer child nodes than client vdom. 
  at <Example> 
  at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< 
undefined
> key="/" > 
  at <BaseTransition mode="out-in" appear=false persisted=false  ... > 
  at <Transition name="page" mode="out-in" > 
  at <NuxtLayout key=0 name=undefined > 
  at <RouterView> 
  at <NuxtPage> 
  at <App> 
  at <Root> 

Hydration completed but contains mismatches.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
cdwmhcccommented, Dec 12, 2021

Has this problem been resolved?

6reactions
nixstromcommented, Jan 10, 2022

I have also created a reproduction repository.

https://github.com/nixstrom/nuxt3-teleport-issue.git

I also created the same scenario in a “vanilla” Vue/Vue-router setup. This was working as expected; the issue only occurs for me when I add Nuxt3 to the mix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-hydration-error - Next.js
In general this issue is caused by using a specific library or application code that is relying on something that could differ between...
Read more >
Server-Side Rendering (SSR) - Vue.js
An easier solution is to conditionally render the Teleport on mount. If you do need to hydrate teleported content, they are exposed under...
Read more >
[Solved]-How to make `teleport` work in SSR in vue3?-Vue.js
To hydrate the teleport content, you need to use teleports property of the SSR context. Then, you need to inject them in the...
Read more >
Teleport Community Edition Now Available in AWS ... - WDTN
Teleport is an identity-native infrastructure access platform for engineers and machines. By replacing insecure secrets with true identity, ...
Read more >
Shadowmane - ARK: Survival Evolved Wiki - Fandom
If they find a target, they will chase after it, teleporting and shocking it. ... This information can be used to alter the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found