You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows standalone executable crashes spawning Worker when autoloadDotenv=false and .env exists #27431
On my machine, removing any one of those stops reproducing.
What is the expected behavior?
The standalone executable should exit cleanly. The presence of a .env file in cwd should not matter when autoloadDotenv is disabled.
What do you see instead?
The compiled executable panics immediately:
panic(thread ...): Internal assertion failure: `ThreadLock` is locked by thread ..., not thread ...
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
One sample crash from this repro:
============================================================
Bun Canary v1.3.10-canary.104 (32a89c43) Windows x64
Windows v.win11_ge
CPU: sse42 avx avx2
Args: "./r.exe"
Features: jsc standalone_executable workers_spawned
Builtins: "bun:main"
Elapsed: 51ms | User: 15ms | Sys: 15ms
RSS: 0.14GB | Peak: 0.14GB | Commit: 0.39GB | Faults: 34252 | Machine: 34.03GB
panic(thread 48292): Internal assertion failure: `ThreadLock` is locked by thread 58860, not thread 48292
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Additional information
Confirmed non-factors in this repro:
extra exec flags are not required
custom worker files are not required
worker contents are not required
explicit env passing is not required
process.chdir() is not required
Confirmed sanity checks:
removing .env avoids the crash
leaving autoloadDotenv at its default avoids the crash
Activity
github-actions commentedon Feb 25, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
fix(standalone): inherit env behavior flags in Worker threads
fix(windows): avoid standalone worker dotenv crash (#27434)
fix(windows): avoid standalone worker dotenv crash (oven-sh#27434)
fix(windows): avoid standalone worker dotenv crash (oven-sh#27434)