Skip to content

Commit

Permalink
wip: fix reentrant error with ReadableStreams in RSC
Browse files Browse the repository at this point in the history
  • Loading branch information
jplhomer committed Jan 19, 2022
1 parent f7adeb8 commit c63f678
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,10 @@ function performWork(request) {
}
}

let reentrant = false;
function flushCompletedChunks(request, destination) {
if (reentrant) return;
reentrant = true;
try {
// We emit module chunks first in the stream so that
// they can be preloaded as early as possible.
Expand Down Expand Up @@ -893,6 +896,7 @@ function flushCompletedChunks(request, destination) {

errorChunks.splice(0, i);
} finally {
reentrant = false;
}

if (request.pendingChunks === 0) {
Expand Down

0 comments on commit c63f678

Please sign in to comment.