nextjs - 💡(How to fix) Fix browser log forwarding cannot be disabled and causes severe performance issues with large console payloads

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…

Error Message

Error Handling

Code Example

Operating System:
  Platform: linux
  Arch: x64
  Version: #27~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 17:38:49 UTC 2
  Available memory (MB): 62977
  Available CPU cores: 28
Binaries:
  Node: 22.22.3
  npm: 10.9.8
  Yarn: N/A
  pnpm: 11.4.0
Relevant Packages:
  next: 16.2.6 // There is a newer version (16.2.7) available, upgrade recommended! 
  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/vercel/next.js

To Reproduce

Next.js overrides browser console methods through next-devtools/userspace/app/forward-logs.js and forwards console output to the development server over a websocket.

In my application some debug logs contain large payloads (tens of megabytes). Profiling shows that most of the execution time is spent inside:

forward-logs.js sendClientFileLogs()

A single console.log() call can result in tens of megabytes being serialized and transmitted through the websocket connection.

Expected behavior:

When one of the following configurations is used:

logging: false

or

logging: { browserToTerminal: false }

browser log forwarding should be completely disabled and console methods should not be wrapped.

Actual behavior:

console.log is still overridden by Next.js and payloads are still forwarded through the websocket. Profiling clearly shows time spent inside forward-logs.js.

Additional information:

Inspecting the browser runtime shows that console.log is replaced with a wrapper similar to:

console.log = (...args) => { wrapper("log", ...args) originalLog.apply(console, args) }

This makes development performance degrade dramatically when logging large application state objects.

Would it be possible to provide a guaranteed way to completely disable browser log forwarding and restore native console methods?

Current vs. Expected behavior

ewfewfewfewfew

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #27~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 17:38:49 UTC 2
  Available memory (MB): 62977
  Available CPU cores: 28
Binaries:
  Node: 22.22.3
  npm: 10.9.8
  Yarn: N/A
  pnpm: 11.4.0
Relevant Packages:
  next: 16.2.6 // There is a newer version (16.2.7) available, upgrade recommended! 
  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)

Error Handling

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