MCPcopy
hub / github.com/facebook/react / emitDebugHaltChunk

Function emitDebugHaltChunk

packages/react-server/src/ReactFlightServer.js:4228–4241  ·  view source on GitHub ↗
(request: Request, id: number)

Source from the content-addressed store, hash-verified

4226}
4227
4228function emitDebugHaltChunk(request: Request, id: number): void {
4229 if (!__DEV__) {
4230 // These errors should never make it into a build so we don't need to encode them in codes.json
4231 // eslint-disable-next-line react-internal/prod-error-codes
4232 throw new Error(
4233 'emitDebugHaltChunk should never be called in production mode. This is a bug in React.',
4234 );
4235 }
4236 // This emits a marker that this row will never complete and should intentionally never resolve
4237 // even when the client stream is closed. We use just the lack of data to indicate this.
4238 const row = id.toString(16) + ':\n';
4239 const processedChunk = stringToChunk(row);
4240 request.completedDebugChunks.push(processedChunk);
4241}
4242
4243function emitDebugChunk(
4244 request: Request,

Callers 3

serializeDebugThenableFunction · 0.85
renderDebugModelFunction · 0.85

Calls 3

stringToChunkFunction · 0.90
toStringMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected