Skip to content

Commit

Permalink
[Fizz] Include componentStack at the root when aborting (#31011)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gnoff committed Sep 20, 2024
1 parent e495392 commit ae75d5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3870,8 +3870,9 @@ function abortTask(task: Task, request: Request, error: mixed): void {
segment.status = ABORTED;
}

const errorInfo = getThrownInfo(task.componentStack);

if (boundary === null) {
const errorInfo: ThrownInfo = {};
if (request.status !== CLOSING && request.status !== CLOSED) {
const replay: null | ReplaySet = task.replay;
if (replay === null) {
Expand Down Expand Up @@ -3957,7 +3958,6 @@ function abortTask(task: Task, request: Request, error: mixed): void {
boundary.pendingTasks--;
// We construct an errorInfo from the boundary's componentStack so the error in dev will indicate which
// boundary the message is referring to
const errorInfo = getThrownInfo(task.componentStack);
const trackedPostpones = request.trackedPostpones;
if (boundary.status !== CLIENT_RENDERED) {
if (enableHalt) {
Expand Down

0 comments on commit ae75d5a

Please sign in to comment.