Closed
Description
Vue version
3.2.45
Link to minimal reproduction
Steps to reproduce
There is a difference between local and the Vue SFC Playground
local
- input
<script setup>
</script>
<template>
<div id="box"></div>
<teleport to="#box" :disabled="true">
<p>text</p>
</teleport>
<teleport to="#box">
<button>Button</button>
</teleport>
</template>
- inject the teleport markup into the correct location in final page HTML
// entry-server.js
const ctx = {}
const html = await renderToString(app, ctx)
console.log(ctx.teleports) // { '#box': '<!--teleport anchor--><button>Button</button><!--teleport anchor-->' }
then modify the content of #box
to
<div id="box"><!--teleport anchor--><button>Button</button><!--teleport anchor--></div>
- hydration error on the client
<div id="box"><button>Button</button><button>Button</button><!--teleport anchor--></div>
What is expected?
render the content correctly
What is actually happening?
[Vue warn]: Hydration children mismatch in
: server rendered element contains fewer child nodes than client vdom.
the wrong DOM was matched on the client
System Info
No response
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
No labels