Skip to content

Commit 5239813

Browse files
committed
temporary patch to fix react bug upstreamed in facebook/react#31169
1 parent f93250c commit 5239813

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -850,16 +850,18 @@ function serializeThenable(request, task, thenable) {
850850
pingTask(request, newTask);
851851
},
852852
function (reason) {
853-
"object" === typeof reason &&
854-
null !== reason &&
855-
reason.$$typeof === REACT_POSTPONE_TYPE
856-
? (logPostpone(request, reason.message, newTask),
857-
emitPostponeChunk(request, newTask.id))
858-
: ((reason = logRecoverableError(request, reason, newTask)),
859-
emitErrorChunk(request, newTask.id, reason));
860-
newTask.status = 4;
861-
request.abortableTasks.delete(newTask);
862-
enqueueFlush(request);
853+
if (newTask.status === 0) {
854+
"object" === typeof reason &&
855+
null !== reason &&
856+
reason.$$typeof === REACT_POSTPONE_TYPE
857+
? (logPostpone(request, reason.message, newTask),
858+
emitPostponeChunk(request, newTask.id))
859+
: ((reason = logRecoverableError(request, reason, newTask)),
860+
emitErrorChunk(request, newTask.id, reason));
861+
newTask.status = 4;
862+
request.abortableTasks.delete(newTask);
863+
enqueueFlush(request);
864+
}
863865
}
864866
);
865867
return newTask.id;

0 commit comments

Comments
 (0)