nextjs - 💡(How to fix) Fix DEP0108: zlib.bytesRead deprecation warning in Turbopack dev mode (RSC flight server) [1 comments, 2 participants]

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…
GitHub stats
vercel/next.js#90327Fetched 2026-04-08 00:20:25
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Error Message

Running with NODE_OPTIONS="--trace-deprecation" reveals the source:

(node:39244) [DEP0108] DeprecationWarning: zlib.bytesRead is deprecated and will change its meaning in the future. Use zlib.bytesWritten instead.
    at renderDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:140744)
    at Object.<anonymous> (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143233)
    at stringify (<anonymous>)
    at emitOutlinedDebugModelChunk (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143177)
    at outlineDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143722)
    at renderDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:135356)
    at Object.<anonymous> (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143233)
    at stringify (<anonymous>)
    at emitOutlinedDebugModelChunk (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143177)

Code Example

(node:PID) [DEP0108] DeprecationWarning: zlib.bytesRead is deprecated and will change its meaning in the future. Use zlib.bytesWritten instead.

---

Operating System:
  Platform: darwin
  Arch: arm64
Node.js: v22.22.0
Next.js: 16.1.6 (Turbopack)

---

(node:39244) [DEP0108] DeprecationWarning: zlib.bytesRead is deprecated and will change its meaning in the future. Use zlib.bytesWritten instead.
    at renderDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:140744)
    at Object.<anonymous> (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143233)
    at stringify (<anonymous>)
    at emitOutlinedDebugModelChunk (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143177)
    at outlineDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143722)
    at renderDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:135356)
    at Object.<anonymous> (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143233)
    at stringify (<anonymous>)
    at emitOutlinedDebugModelChunk (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143177)
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/vercel/next.js

To Reproduce

  1. Create any Next.js app using App Router
  2. Run next dev --turbopack with Node.js 22+
  3. Navigate to any page that uses React Server Components
  4. Observe the deprecation warning in the terminal on first page load

Current vs. Expected behavior

Current: On the first RSC render, Node.js emits:

(node:PID) [DEP0108] DeprecationWarning: zlib.bytesRead is deprecated and will change its meaning in the future. Use zlib.bytesWritten instead.

Expected: No deprecation warning.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
Node.js: v22.22.0
Next.js: 16.1.6 (Turbopack)

Stack trace

Running with NODE_OPTIONS="--trace-deprecation" reveals the source:

(node:39244) [DEP0108] DeprecationWarning: zlib.bytesRead is deprecated and will change its meaning in the future. Use zlib.bytesWritten instead.
    at renderDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:140744)
    at Object.<anonymous> (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143233)
    at stringify (<anonymous>)
    at emitOutlinedDebugModelChunk (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143177)
    at outlineDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143722)
    at renderDebugModel (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:135356)
    at Object.<anonymous> (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143233)
    at stringify (<anonymous>)
    at emitOutlinedDebugModelChunk (.../node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js:25:143177)

Additional context

The deprecated zlib.bytesRead property is being read inside the compiled React Flight server code (app-page-turbo.runtime.dev.js) during RSC debug model serialization. This is dev-mode only and does not affect production builds.

The fix should be a one-line change: replace zlib.bytesRead with zlib.bytesWritten in the upstream React Flight server code that gets compiled into Next.js. See Node.js DEP0108.

The warning only appears once per process (Node.js suppresses repeated deprecation warnings), so it shows on first page load and not on subsequent refreshes.

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

Turbopack

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

next dev (local)

extent analysis

Fix: Replace deprecated zlib.bytesRead with zlib.bytesWritten in the dev‑runtime

The warning is emitted only in dev mode from the compiled file
node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js.
Updating the reference removes the deprecation warning.

Step‑by‑step solution

  1. Add a post‑install patch (so the change survives npm install / yarn install).

    // package.json
    {
      "scripts": {
        "postinstall": "node ./scripts/patch-next-zlib.js"
      }
    }
  2. Create the patch script (scripts/patch-next-zlib.js).

    // scripts/patch-next-zlib.js
    const fs = require('fs');
    const path = require('path');
    
    // Resolve the compiled dev runtime that contains the offending code
    const runtimePath = path.resolve(
      __dirname,
      '..',
      'node_modules',
      'next',
      'dist',
      'compiled',
      'next-server',
      'app-page-turbo.runtime.dev.js'
    );
    
    if (!fs.existsSync(runtime

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