Skip to content

Commit ae75d5a

Browse files
authored
[Fizz] Include componentStack at the root when aborting (#31011)
When aborting we currently don't produce a componentStack when aborting the shell. This is likely just an oversight and this change updates this behavior to be consistent with what we do when there is a boundary
1 parent e495392 commit ae75d5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-server/src/ReactFizzServer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3870,8 +3870,9 @@ function abortTask(task: Task, request: Request, error: mixed): void {
38703870
segment.status = ABORTED;
38713871
}
38723872

3873+
const errorInfo = getThrownInfo(task.componentStack);
3874+
38733875
if (boundary === null) {
3874-
const errorInfo: ThrownInfo = {};
38753876
if (request.status !== CLOSING && request.status !== CLOSED) {
38763877
const replay: null | ReplaySet = task.replay;
38773878
if (replay === null) {
@@ -3957,7 +3958,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
39573958
boundary.pendingTasks--;
39583959
// We construct an errorInfo from the boundary's componentStack so the error in dev will indicate which
39593960
// boundary the message is referring to
3960-
const errorInfo = getThrownInfo(task.componentStack);
39613961
const trackedPostpones = request.trackedPostpones;
39623962
if (boundary.status !== CLIENT_RENDERED) {
39633963
if (enableHalt) {

0 commit comments

Comments
 (0)