Subscribe on changes!

Rendering fragment using SFC compiler in SSR mode adds comments

avatar
Jul 20th 2021

Version

3.2.0-beta.2

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8aDE+MTIzPC9oMT5cbiAgPGgxPjQ1NjwvaDE+XG48L3RlbXBsYXRlPlxuIn0=

Steps to reproduce

Go to the SSR tab in the right panel.

What is expected?

The compiler renders two h1 tags with their content and nothing else.

What is actually happening?

The compiler renders two h1 tags surrounded by comments.


These comments seem to throw off hydration in the client, causing some elements to be duplicated.

avatar
Jul 20th 2021

This is expected behavior because the comments are necessary for correct client-side hydration (because of potential async components inside fragments)

avatar
Jul 21st 2021

Turns out it was something unrelated causing the problem, as always. Thank you for your great work.