Skip to content

Commit 4ba11f9

Browse files
committed
fix(octane): check scoped props before reading children in descriptorProps
descriptorProps unconditionally read d.children before checking SCOPED_ELEMENT_PROPS. For scoped descriptors this triggers the getScopedChildren getter, running the deferred children resolver in the parent scope (wrong context, wrong suspense/error owner). Move the SCOPED_ELEMENT_PROPS guard before the d.children access, restoring the original three-branch ordering that returned d.props without touching children for scoped descriptors.
1 parent a51aadc commit 4ba11f9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/octane/src/runtime.server.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,8 +2354,9 @@ export function ssrTextPre(v: unknown): string {
23542354
// with a distinct non-null children field need a repaired props object.
23552355
/** The props a component descriptor renders its component with, its children among them. */
23562356
function descriptorProps(d: ElementDescriptor): any {
2357+
if (SCOPED_ELEMENT_PROPS.has(d.props)) return d.props;
23572358
const children = d.children;
2358-
return SCOPED_ELEMENT_PROPS.has(d.props) || children == null || children === d.props?.children
2359+
return children == null || children === d.props?.children
23592360
? d.props
23602361
: { ...d.props, children };
23612362
}

0 commit comments

Comments
 (0)