Skip to content

Commit

Permalink
Resolve shell when a replay task errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Oct 4, 2023
1 parent 352f0b6 commit 35f1d0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,11 @@ describe('ReactDOMFizzStaticBrowser', () => {
return children;
}

const lazySpan = React.lazy(async () => {
await 0;
return {default: <span />};
});

function App() {
const children = (
<Suspense fallback="Loading...">
Expand All @@ -1013,7 +1018,7 @@ describe('ReactDOMFizzStaticBrowser', () => {
</div>
</Suspense>
) : (
<span />
lazySpan
)}
</div>
</>
Expand Down
6 changes: 6 additions & 0 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3464,6 +3464,12 @@ function retryReplayTask(request: Request, task: ReplayTask): void {
task.replay.nodes,
task.replay.slots,
);
request.pendingRootTasks--;
if (request.pendingRootTasks === 0) {
request.onShellError = noop;
const onShellReady = request.onShellReady;
onShellReady();
}
request.allPendingTasks--;
if (request.allPendingTasks === 0) {
const onAllReady = request.onAllReady;
Expand Down

0 comments on commit 35f1d0f

Please sign in to comment.