This repository reproduces a Vue SSR bug when using v-html
on a component that has a root dynamic-component (eg. <component />
). Although there isn't a discrepancy in rendered HTML between client and SSR, it gives warnings that there is.
The expected behavior is for there to be no hydration warning when the SSR and client markup are identical.
Dynamic.vue
<template>
<component is="div">
content necessary
</component>
</template>
App.vue
<template>
<dynamic v-html="'<div>trigger hydration warning</div>'" />
</template>
- Clone repo
- Install deps
npm ci
npm run dev
to start SSR NUXT server- Visting landing page and view Dev console
<dynamic-comp-content v-html="'<div>D. warn</div>'" />
<div><div class="dynamic-comp-content"><div>D. warn</div></div></div>
<div><div class="dynamic-comp-content"><div>D. warn</div></div></div>
<dynamic-comp-wrapped v-html="'E. warn'" />
<div><div>E. warn</div></div>
<div><div>E. warn</div></div>