Skip to content

Commit 5156ac5

Browse files
authoredNov 10, 2023
fix(ssr): hydration __vnode missing for devtools (#9328)
1 parent e15dc05 commit 5156ac5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎packages/runtime-core/src/hydration.ts

+15
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@ export function createHydrationFunctions(
111111
let domType = node.nodeType
112112
vnode.el = node
113113

114+
if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
115+
if (!('__vnode' in node)) {
116+
Object.defineProperty(node, '__vnode', {
117+
value: vnode,
118+
enumerable: false
119+
})
120+
}
121+
if (!('__vueParentComponent' in node)) {
122+
Object.defineProperty(node, '__vueParentComponent', {
123+
value: parentComponent,
124+
enumerable: false
125+
})
126+
}
127+
}
128+
114129
if (patchFlag === PatchFlags.BAIL) {
115130
optimized = false
116131
vnode.dynamicChildren = null

0 commit comments

Comments
 (0)
Please sign in to comment.