-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.
Description
Link to the code that reproduces this issue
https://github.com/paulbrimicombe/nextjs-stream-consumers-bug?target=https://github.com
To Reproduce
- Install dependencies:
npm install - Attempt to build the code using Turbopack:
npm run build— the errorModule not found: Can't resolve 'stream/consumers'will be displayed - Attempt to build the code using Webpack:
npm run build -- --webpack— no errors will be shown - Update the code in
page.tsxto add thenode:prefix to thestream/consumersimport - Attempt to build the code using Turbopack:
npm run build— the errorCannot find module 'node:stream/consumers': Unsupported external type Url for commonjs referencewill be displayed
Current vs. Expected behavior
- Utility consumer functions should be able to be imported without the
node:prefix (like other Node.js libraries). - These functions should be able to be imported in CommonJS code
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Wed Nov 5 21:30:44 PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T6041
Available memory (MB): 24576
Available CPU cores: 14
Binaries:
Node: 22.21.1
npm: 11.10.0
Yarn: 1.22.22
pnpm: 10.28.0
Relevant Packages:
next: 16.1.6 // Latest available version is detected (16.1.6).
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
A quick search of the Turbopack codebase for similar Node.js libraries such as stream/promises or stream/web indicates that there is some missing handling for stream/consumers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.