File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -659,6 +659,17 @@ export function createHydrationFunctions(
659659 )
660660 }
661661 }
662+
663+ // the server output does not contain blank text nodes. It appears here that
664+ // it is a dynamically inserted anchor, and needs to be skipped.
665+ // e.g. vaporInteropImpl.mount() > selfAnchor
666+ if (
667+ node &&
668+ node . nodeType === DOMNodeTypes . TEXT &&
669+ ! ( node as Text ) . data . trim ( )
670+ ) {
671+ node = nextSibling ( node )
672+ }
662673 return node
663674 }
664675
Original file line number Diff line number Diff line change @@ -62,9 +62,7 @@ const vaporInteropImpl: Omit<
6262> = {
6363 mount ( vnode , container , anchor , parentComponent ) {
6464 let selfAnchor = ( vnode . el = vnode . anchor = createTextNode ( ) )
65- if ( ! isHydrating ) {
66- container . insertBefore ( selfAnchor , anchor )
67- }
65+ container . insertBefore ( selfAnchor , anchor )
6866 const prev = currentInstance
6967 simpleSetCurrentInstance ( parentComponent )
7068
@@ -90,12 +88,6 @@ const vaporInteropImpl: Omit<
9088 ) )
9189 instance . rawPropsRef = propsRef
9290 instance . rawSlotsRef = slotsRef
93- if ( isHydrating ) {
94- // insert self anchor after hydration completed to avoid mismatching
95- ; ( instance . m || ( instance . m = [ ] ) ) . push ( ( ) => {
96- container . insertBefore ( selfAnchor , anchor )
97- } )
98- }
9991 mountComponent ( instance , container , selfAnchor )
10092 simpleSetCurrentInstance ( prev )
10193 return instance
You can’t perform that action at this time.
0 commit comments