Turbopack build panic hides NUL-byte environment variable spawn error behind CSS module
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/abdoufma/turbopack-nul-env-repro
To Reproduce
This issue requires launching Next.js from a Windows process session where Node observes an inherited environment variable containing a NUL byte.
In the affected session, confirm the environment:
node scripts/detect-nul-env.cjs
Observed:
Environment variables containing NUL bytes:
- steam_master_ipc_name_override = "Remote\u0000"
Then run the Turbopack build directly:
node node_modules/next/dist/bin/next build --turbo
Current vs. Expected behavior
Current behavior:
Turbopack fails with an internal error that points at an ordinary CSS file:
Failed to write app endpoint /page
Caused by:
- [project]/app/globals.css [app-client] (css)
- creating new process
- spawning node pooled process
- nul byte found in provided data
The panic path continues through CSS/PostCSS:
Execution of parse_css failed
Execution of <PostCssTransformedAsset as Asset>::content failed
Execution of PostCssTransformedAsset::process failed
Execution of evaluate_webpack_loader failed
creating new process
spawning node pooled process
nul byte found in provided data
Expected behavior:
Turbopack should surface the underlying child-process spawn/environment error with the offending environment variable name, similar to the Webpack build path:
node node_modules/next/dist/bin/next build --webpack
Webpack reports:
TypeError: The property 'options.env['steam_master_ipc_name_override']' must be a string without null bytes. Received 'Remote\x00'
I am not expecting Turbopack to support malformed environment values. The bug is that the diagnostic points at an unrelated CSS module and hides the actionable environment variable name.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 16255
Available CPU cores: 12
Binaries:
Node: 24.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 16.3.1-canary.12
eslint-config-next: N/A
react: 19.2.8
react-dom: 19.2.8
typescript: 7.0.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
CSS, Error Handling, Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
The same original application builds on another Windows server where the malformed inherited environment variable is not present.
This minimal reproduction uses next@canary, locked to 16.3.1-canary.12.
Fresh verification from this repro on August 12, 2026:
node scripts/detect-nul-env.cjsreportssteam_master_ipc_name_override = "Remote\u0000".node node_modules/next/dist/bin/next build --turbofails withTurbopackInternalErrorandnul byte found in provided dataunderapp/globals.css/ PostCSS.node node_modules/next/dist/bin/next build --webpackfails with Node's actionableERR_INVALID_ARG_VALUEand includesoptions.env['steam_master_ipc_name_override'].
The generated Turbopack report URL from the canary CLI included:
Turbopack version: `40503aae`
Next.js version: `0.0.0`
The 0.0.0 version in the generated report URL looks suspicious because the CLI header correctly prints:
Next.js 16.3.1-canary.12
Related but different reports found before opening this issue:
- https://github.com/vercel/next.js/issues/90860: similar CSS/PostCSS/Turbopack area, but caused by a project-root file named
nul/ Windows device path behavior. - https://github.com/vercel/next.js/issues/96412: same child-process area, but caused by
STATUS_DLL_INIT_FAILEDrather than a NUL byte in an inherited environment variable. - https://github.com/vercel/next.js/discussions/89780: same "spawning node pooled process" area, but the error is
program not found.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction and run scripts/detect-nul-env.cjs, then compare next build --turbo with next build --webpack on Windows. Trace the failure reported under app/globals.css and the "spawning node pooled process" path. Done means Turbopack exposes the underlying NUL-byte environment error, including the offending variable name, instead of attributing it to the CSS module.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript, next.js, node.js
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100