Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled teleport inside fragment causes SSR hydration mismatches #6152

Closed
KaelWD opened this issue Jun 21, 2022 · 2 comments · Fixed by #9399
Closed

Disabled teleport inside fragment causes SSR hydration mismatches #6152

KaelWD opened this issue Jun 21, 2022 · 2 comments · Fixed by #9399
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: ssr scope: teleport

Comments

@KaelWD
Copy link
Contributor

KaelWD commented Jun 21, 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#__DEV____SSR__eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cD5cbmltcG9ydCBDb21wIGZyb20gJy4vQ29tcC52dWUnXG48L3NjcmlwdD5cblxuPHRlbXBsYXRlPlxuICA8ZGl2PlxuICAgIFBhcmVudCBmcmFnbWVudFxuICA8L2Rpdj5cbiAgPENvbXA+PC9Db21wPlxuPC90ZW1wbGF0ZT4iLCJpbXBvcnQtbWFwLmpzb24iOiJ7XG4gIFwiaW1wb3J0c1wiOiB7XG4gICAgXCJ2dWVcIjogXCJodHRwczovL3VucGtnLmNvbS9AdnVlL3J1bnRpbWUtZG9tQDMuMi4zNy9kaXN0L3J1bnRpbWUtZG9tLmVzbS1icm93c2VyLmpzXCIsXG4gICAgXCJ2dWUvc2VydmVyLXJlbmRlcmVyXCI6IFwiaHR0cHM6Ly91bnBrZy5jb20vQHZ1ZS9zZXJ2ZXItcmVuZGVyZXJAMy4yLjM3L2Rpc3Qvc2VydmVyLXJlbmRlcmVyLmVzbS1icm93c2VyLmpzXCJcbiAgfVxufSIsIkNvbXAudnVlIjoiPHRlbXBsYXRlPlxuICA8VGVsZXBvcnQgZGlzYWJsZWQgdG89XCJib2R5XCI+XG4gICAgPGRpdj5cbiAgICAgIFRlbGVwb3J0IGNvbnRlbnRcbiAgICA8L2Rpdj5cbiAgPC9UZWxlcG9ydD5cbjwvdGVtcGxhdGU+In0=

Steps to reproduce

N/A

What is expected?

No warnings

What is actually happening?

Hydration completed but contains mismatches with no information about where they are.

} else {
// fragment didn't hydrate successfully, since we didn't get a end anchor
// back. This should have led to node/children mismatch warnings.
hasMismatch = true
// since the anchor is missing, we need to create one and insert it
insert((vnode.anchor = createComment(`]`)), container, next)
return next
}

This newly inserted anchor can then cause Hydration children mismatch in <div>: server rendered element contains more child nodes than client vdom in its parent element.

System Info

No response

Any additional comments?

Having a separate warning for "fragment didn't hydrate successfully" would be nice too.

@edison1105 edison1105 added scope: teleport scope: ssr ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Jun 21, 2022
@KaelWD
Copy link
Contributor Author

KaelWD commented Jun 21, 2022

b60cff0 didn't account for disabled teleport, nextNode is the teleport content instead of <!--teleport end-->

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. scope: ssr scope: teleport
Projects
None yet
4 participants