Skip to content

fix : cap react debug channel data sent over hmr in dev#93982

Open
nehaprasad-dev wants to merge 1 commit into
vercel:canaryfrom
nehaprasad-dev:fix/exc-dat-snt-ren-crsh
Open

fix : cap react debug channel data sent over hmr in dev#93982
nehaprasad-dev wants to merge 1 commit into
vercel:canaryfrom
nehaprasad-dev:fix/exc-dat-snt-ren-crsh

Conversation

@nehaprasad-dev
Copy link
Copy Markdown

what?

  • Cap dev HMR debug channel traffic at 1 MB.

Why?

  • Large server-only reads were forwarded whole to the browser and could crash the renderer.

How?

  • Limit bytes in connectReactDebugChannel, truncate the last chunk, cancel the reader, send chunk: null.

Fixes : #93967

Comment on lines +15 to +17
const result = takeReactDebugChunkForHmr(chunk, 3, 10)

expect(result.chunk).toEqual(new Uint8Array([4, 5]))
Copy link
Copy Markdown
Contributor

@vercel vercel Bot May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test "truncates a chunk that would exceed the limit" has incorrect inputs and expectations that don't match the function's behavior, causing the test to fail.

Fix on Vercel

@eps1lon eps1lon requested a review from unstubbable May 27, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Excessive data sent over hmr socket to client, causing renderer to crash

1 participant