The Garden
Showing 1 of 10 notes.
Not sure where to start? Follow a trail →
- Why doesn't Bun.spawn see the env var I just set? 🌱 seedling · EN · VI
Set process.env.X in a Bun script, call Bun.spawn without passing env, and the child never sees X. It gets the environment the script started with. I measured seven ways to start a child on 12 Bun versions, 1.0.0 to 1.4.4: Bun.spawn misses on all of them, and node:child_process missed up to 1.3.14. The fix is to pass env: process.env explicitly.