Skip to content

Commit 3705b3b

Browse files
committed
fix(ssr): fix hydration error when transition contains comment children
fix #5351
1 parent aed10c5 commit 3705b3b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/compiler-ssr/src/transforms/ssrTransformComponent.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import {
3535
CREATE_VNODE,
3636
CallExpression,
3737
JSChildNode,
38-
RESOLVE_DYNAMIC_COMPONENT
38+
RESOLVE_DYNAMIC_COMPONENT,
39+
TRANSITION
3940
} from '@vue/compiler-dom'
4041
import { SSR_RENDER_COMPONENT, SSR_RENDER_VNODE } from '../runtimeHelpers'
4142
import {
@@ -213,6 +214,10 @@ export function ssrProcessComponent(
213214
if ((parent as WIPSlotEntry).type === WIP_SLOT) {
214215
context.pushStringPart(``)
215216
}
217+
// #5351: filter out comment children inside transition
218+
if (component === TRANSITION) {
219+
node.children = node.children.filter(c => c.type !== NodeTypes.COMMENT)
220+
}
216221
processChildren(node, context)
217222
}
218223
} else {

0 commit comments

Comments
 (0)