Skip to content

Vue SSR fails with innerHTML #6519

@nickmessing

Description

@nickmessing

Version

2.4.2

Reproduction link

https://github.com/nickmessing/vue-ssr-issue

Steps to reproduce

Use domPropsInnerHTML in JSX or v-html in Vue Template.

Or:

What is expected?

No warning in console.

What is actually happening?

DOM Mismatching error.


v-html works fine when there are no children, but fails if there are.

One option is to completely ignore innerHTML and v-html in vue-ssr. Basically commenting this line solves the problem.

Another option is evaluating innerHTML before comparing DOM snapshots so you get value from innerHTML on static SSR-rendered website without DOM Mismatch.

Third option is ignoring children in createElment if there is innerHTML domProp. I think this one is the best.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions