vue
vue copied to clipboard
Vue SSR v-html on dynamic-component hydration warning
Version
2.6.11
Reproduction link
The reproduction is updated to use Vue SSR without NUXT https://github.com/privatenumber/vue-ssr-vhtml-dyncomp-bug
Steps to reproduce
Dynamic.vue
<template>
<component is="div">
content necessary
</component>
</template>
App.vue
<template>
<dynamic v-html="'<div>trigger hydration warning</div>'" />
</template>
What is expected?
The expected behavior is for there to be no hydration warning when the SSR and client markup are identical.
What is actually happening?
Although there isn't a discrepancy in rendered HTML between client and SSR, it gives warnings that there is.
Work around
I used a render function instead of a dynamic-component:
render(h) {
return h(this.component, this.$slots.default);
}
Other info
Previous issue: https://github.com/vuejs/vue/issues/11532
nice bug report. very thorough
Having the same issue.
SSR node counting strategy does not work properly when injecting HTML via the v-html prop.
This issue has a "has workaround" label - whats the workaround here? Having the same problem