mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 12:29:07 +00:00
Node.js coerces all values assigned to process.env properties to strings. For example, `process.env.FOO = undefined` results in `process.env.FOO` being the string `"undefined"`, not the JavaScript `undefined` value. Bun was storing the actual JavaScript values, which broke compatibility with tools like Vite 8 + rolldown that expect string values. This change: - Adds a Proxy wrapper for process.env on non-Windows platforms (similar to the existing Windows implementation) that coerces values to strings - Uses string concatenation (`'' + value`) instead of `String(value)` to throw for Symbols, matching Node.js behavior - Also fixes the Windows implementation to throw for Symbols Fixes #26388 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>