Skip to content

[turbopack] Surface NUL-byte env var in Node.js pool spawn error - #97281

Open
AmatyaJoshi wants to merge 1 commit into
vercel:canaryfrom
AmatyaJoshi:fix/turbopack-nul-byte-env-error
Open

[turbopack] Surface NUL-byte env var in Node.js pool spawn error#97281
AmatyaJoshi wants to merge 1 commit into
vercel:canaryfrom
AmatyaJoshi:fix/turbopack-nul-byte-env-error

Conversation

@AmatyaJoshi

Copy link
Copy Markdown

When Turbopack spawns a pooled Node.js subprocess with an environment variable whose name or value contains a NUL byte, Command::spawn fails with only "nul byte found in provided data". The surrounding transform pipeline (e.g. PostCSS on globals.css) then attributes the failure to the module being processed, hiding the real cause.

Validate env entries before spawning and bail with a message that names the offending variable and shows its value, matching webpack's behavior.

Fixes #97265

When Turbopack spawns a pooled Node.js subprocess with an environment
variable whose name or value contains a NUL byte, `Command::spawn`
fails with only "nul byte found in provided data". The surrounding
transform pipeline (e.g. PostCSS on globals.css) then attributes the
failure to the module being processed, hiding the real cause.

Validate env entries before spawning and bail with a message that
names the offending variable and shows its value, matching webpack's
behavior.

Fixes vercel#97265

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turbopack build panic hides NUL-byte environment variable spawn error behind CSS module

1 participant