Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

privatenumber/vue-ssr-vhtml-dyncomp-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue SSR v-html on dynamic-component bug

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.

Simple example

Dynamic.vue

<template>
  <component is="div">
    content necessary
  </component>
</template>

App.vue

<template>
  <dynamic v-html="'<div>trigger hydration warning</div>'" />
</template>

Reproduction

  1. Clone repo
  2. Install deps npm ci
  3. npm run dev to start SSR NUXT server
  4. Visting landing page and view Dev console

Results

D

Code

Vue code

<dynamic-comp-content v-html="'<div>D. warn</div>'" />

Warning

SSR output

<div><div class="dynamic-comp-content"><div>D. warn</div></div></div>

Client output

<div><div class="dynamic-comp-content"><div>D. warn</div></div></div>

E

Code

Vue code

<dynamic-comp-wrapped v-html="'E. warn'" />

Warning

SSR output

<div><div>E. warn</div></div>

Client output

<div><div>E. warn</div></div>

About

Vue SSR v-html on dynamic-component bug reproduction

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published