Skip to content

Commit 9ec0211

Browse files
committed
Don't block chunks on debug channel if it's not wired up
See facebook#33757.
1 parent 28aaa3d commit 9ec0211

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/react-client/src/ReactFlightClient.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,6 +3471,26 @@ function resolveDebugModel(
34713471
debugChunk._debugChunk = previousChunk; // Linked list of the debug chunks
34723472
parentChunk._debugChunk = debugChunk;
34733473
initializeDebugChunk(response, parentChunk);
3474+
if (
3475+
__DEV__ &&
3476+
((debugChunk: any): SomeChunk<any>).status === BLOCKED &&
3477+
// TODO: This should check for the existence of the "readable" side, not the "writable".
3478+
response._debugChannel === undefined
3479+
) {
3480+
if (json[0] === '"' && json[1] === '$') {
3481+
const path = json.slice(2, json.length - 1).split(':');
3482+
const outlinedId = parseInt(path[0], 16);
3483+
const chunk = getChunk(response, outlinedId);
3484+
if (chunk.status === PENDING) {
3485+
// We expect the debug chunk to have been emitted earlier in the stream. It might be
3486+
// blocked on other things but chunk should no longer be pending.
3487+
// If it's still pending that suggests that it was referencing an object in the debug
3488+
// channel, but no debug channel was wired up so it's missing. In this case we can just
3489+
// drop the debug info instead of halting the whole stream.
3490+
parentChunk._debugChunk = null;
3491+
}
3492+
}
3493+
}
34743494
}
34753495

34763496
let currentOwnerInDEV: null | ReactComponentInfo = null;

0 commit comments

Comments
 (0)