@@ -35,6 +35,8 @@ const {
3535 setupComponent,
3636 renderComponentRoot,
3737 normalizeVNode,
38+ pushWarningContext,
39+ popWarningContext,
3840} = ssrUtils
3941
4042export type SSRBuffer = SSRBufferItem [ ] & { hasAsync ?: boolean }
@@ -91,8 +93,14 @@ export function renderComponentVNode(
9193 parentComponent : ComponentInternalInstance | null = null ,
9294 slotScopeId ?: string ,
9395) : SSRBuffer | Promise < SSRBuffer > {
94- const instance = createComponentInstance ( vnode , parentComponent , null )
96+ const instance = ( vnode . component = createComponentInstance (
97+ vnode ,
98+ parentComponent ,
99+ null ,
100+ ) )
101+ if ( __DEV__ ) pushWarningContext ( vnode )
95102 const res = setupComponent ( instance , true /* isSSR */ )
103+ if ( __DEV__ ) popWarningContext ( )
96104 const hasAsyncSetup = isPromise ( res )
97105 let prefetches = instance . sp /* LifecycleHooks.SERVER_PREFETCH */
98106 if ( hasAsyncSetup || prefetches ) {
@@ -118,6 +126,7 @@ function renderComponentSubTree(
118126 instance : ComponentInternalInstance ,
119127 slotScopeId ?: string ,
120128) : SSRBuffer | Promise < SSRBuffer > {
129+ if ( __DEV__ ) pushWarningContext ( instance . vnode )
121130 const comp = instance . type as Component
122131 const { getBuffer, push } = createBuffer ( )
123132 if ( isFunction ( comp ) ) {
@@ -207,6 +216,7 @@ function renderComponentSubTree(
207216 push ( `<!---->` )
208217 }
209218 }
219+ if ( __DEV__ ) popWarningContext ( )
210220 return getBuffer ( )
211221}
212222
0 commit comments