Skip to content

Commit

Permalink
fix(ssr): fix hydration error when transition contains comment children
Browse files Browse the repository at this point in the history
fix #5351
  • Loading branch information
yyx990803 committed May 18, 2022
1 parent aed10c5 commit 3705b3b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import {
CREATE_VNODE,
CallExpression,
JSChildNode,
RESOLVE_DYNAMIC_COMPONENT
RESOLVE_DYNAMIC_COMPONENT,
TRANSITION
} from '@vue/compiler-dom'
import { SSR_RENDER_COMPONENT, SSR_RENDER_VNODE } from '../runtimeHelpers'
import {
Expand Down Expand Up @@ -213,6 +214,10 @@ export function ssrProcessComponent(
if ((parent as WIPSlotEntry).type === WIP_SLOT) {
context.pushStringPart(``)
}
// #5351: filter out comment children inside transition
if (component === TRANSITION) {
node.children = node.children.filter(c => c.type !== NodeTypes.COMMENT)
}
processChildren(node, context)
}
} else {
Expand Down

0 comments on commit 3705b3b

Please sign in to comment.