nextjs - 💡(How to fix) Fix Excessive data sent over hmr socket to client, causing renderer to crash [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

Operating System:
  Platform: linux
  Arch: arm64
  Version: #1 SMP Fri May  1 14:35:41 UTC 2026
  Available memory (MB): 15972
  Available CPU cores: 14
Binaries:
  Node: 24.14.0
  npm: 11.9.0
  Yarn: 1.22.22
  pnpm: 10.31.0
Relevant Packages:
  next: 16.3.0-canary.24 // Latest available version is detected (16.3.0-canary.24).
  eslint-config-next: N/A
  react: 19.2.6
  react-dom: 19.2.6
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/irnc/next-hmr-excessive-data

To Reproduce

  1. Start app using npm run dev
  2. Open Chrome DevTools > Network > hmr socket
  3. Notice that string returned from readFile are sent to client in full.

Current vs. Expected behavior

In the reproduction code I create a JSON file with array of 10m numbers, which results in 76 MB file. Content of this file is read using fs.readFile.

https://github.com/irnc/next-hmr-excessive-data/blob/68501fa4d47ef0a39106e5098f3241acf604d5cd/app/page.tsx#L1-L15

Running Next.js in dev mode I see that content of that file is streamed to browser using hmr socket. This data is used to show suspended by in React DevTools.

It may be helpful for debugging. It works on small data. But on my local project I read JSON files of 300 MB in server components (data is consumed on server, not passed to client), which is sent in full to a browser over hmr socket, which causes render process crash.

Thus app in dev mode crashes browser render process.

Provide environment information

Operating System:
  Platform: linux
  Arch: arm64
  Version: #1 SMP Fri May  1 14:35:41 UTC 2026
  Available memory (MB): 15972
  Available CPU cores: 14
Binaries:
  Node: 24.14.0
  npm: 11.9.0
  Yarn: 1.22.22
  pnpm: 10.31.0
Relevant Packages:
  next: 16.3.0-canary.24 // Latest available version is detected (16.3.0-canary.24).
  eslint-config-next: N/A
  react: 19.2.6
  react-dom: 19.2.6
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

React

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING