vercel / vercel/next.js

[Turbopack Nextjs 16]: Pino - Cannot find module './transport-stream'

Open
#87,342 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Turbopack
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

This is the same issue as #86099. The original issue deviated to Turbopack + non-Vercel deployment and closed after that case was fixed. However, the Turbopack + Vercel deployment (AWS Lambda) scenario still has the errors below, tested with v16.1.0.

Thanks @lukesandberg for the workaround https://github.com/CHC383/nextjs-turbopack-pino-reproduction/pull/1


Link to the code that reproduces this issue

https://github.com/CHC383/nextjs-turbopack-pino-reproduction

To Reproduce
  1. Deploy the code to Vercel
  2. Visit /api/log
  3. Check the log of the Vercel deployment
Current vs. Expected behavior

Current behavior

With Turbopack in NextJs v16, Pino worker thread throws the following error:

Uncaught Exception: Error: Cannot find module './transport-stream'
Require stack:
- /var/task/node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/worker.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1383:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
    at Module._load (node:internal/modules/cjs/loader:1192:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Module.require (node:internal/modules/cjs/loader:1463:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (/var/task/node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/worker.js:7:36)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)

Expected behavior

Pino worker thread works without any exception, which is the behavior of using WebPack.

Provide environment information
Operating System:
  Platform: linux
  Arch: x64
  Version: #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025
  Available memory (MB): 15839
  Available CPU cores: 20
Binaries:
  Node: 24.12.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.26.0
Relevant Packages:
  next: 16.1.0 // Latest available version is detected (16.1.0).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Turbopack

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

Vercel (Deployed)

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked nextjs-turbopack-pino-reproduction repository and reproduce the failure by deploying to Vercel, visiting /api/log, and checking the deployment log. Then inspect the Pino worker entry point at node_modules/pino/lib/worker.js and compare the Turbopack deployment with the stated Webpack behavior. Done means the Pino worker runs on the Vercel AWS Lambda deployment without the missing-module exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, nextjs, node.js
Domain
build-system, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.