-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Second instance of a duplicate component VNode isn't rendered on the client-side when using SSR #14635
Copy link
Copy link
Open
Labels
has workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problemscope: ssr🔩 p2-edge-case
Description
Vue version
3.5.31
Link to minimal reproduction
Steps to reproduce
Use a SSR app with a component where the render function uses the same component VNode reference at multiple positions in the children array.
The component must be mounted on the client after initial hydration (e.g. via v-if).
For context: I stumbled upon this issue when using vue-i18n's <i18n-t> component with a translation message containing the same named placeholder twice (e.g. "Click this {link} and that {link}."). Internally, <i18n-t> calls the slot function once and reuses the returned VNode for each occurrence of the placeholder:
<!-- someMessage: "Click this {link} and that {link}." -->
<i18n-t keypath="someMessage">
<template #link>
<NuxtLink>
link
</NuxtLink>
</template>
</i18n-t>What is expected?
"Click this link and that link."
Both instances of the component should render independently.
What is actually happening?
"Click this link and that ."
The second instance silently doesn't render. This only affects:
- component VNodes (plain element VNodes render both instances correctly)
createSSRApp- withcreateAppboth instances render correctly- components mounted after initial hydration. During SSR hydration itself both instances render correctly.
System Info
Any additional comments?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
has workaroundA workaround has been found to avoid the problemA workaround has been found to avoid the problemscope: ssr🔩 p2-edge-case