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
Bun NAPI crash on exit: panic: NAPI FATAL ERROR: Error::New napi_create_error #32544
Every time opencode exits, it crashes with a Bun runtime fatal error:
panic: NAPI FATAL ERROR: Error::New napi_create_error
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
The full crash includes the Bun report URL and a macOS crash report (SIGTRAP on a Worker thread) written to ~/Library/Logs/DiagnosticReports/opencode-*.ips.
Root cause: OpenCode ships as a Bun standalone executable (Bun v1.3.14). Bun v1.3.14 has a bug where NAPI finalizer tasks crash during process exit cleanup — when Zig__GlobalObject__destructOnExit runs a final GC sweep, deferred NAPI finalizers try to create error objects through an already-partially-torn-down runtime. Related upstream Bun issue: oven-sh/bun#32144
Impact: The crash happens after all work is done — no data loss, but noisy and produces spurious crash reports.
Platform: macOS 26.5.1 (Apple Silicon), opencode v1.17.7 (Homebrew), Bun v1.3.14
Fix: Rebuild opencode with a Bun version that includes a fix for the NAPI finalizer cleanup race. Currently both opencode and Bun are at v1.3.14 — this issue can be closed once the Bun fix is released and opencode picks it up.
No issue template was used. Please use one of the three templates: Bug Report, Feature Request, or Question. Bug reports require the standard fields (Description, Steps to Reproduce, etc.).
The description appears to be AI-generated. We ask that issues be written in your own words describing what you actually experienced — long, AI-written analyses are not acceptable.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Closing as a duplicate of #31563 — same platform (macOS Apple Silicon), same embedded Bun 1.3.14, same crash-on-exit with trace trap. #31563 was filed first with more detail. The upstream Bun fix is tracked at oven-sh/bun#32144.
Activity
github-actions commentedon Jun 16, 2026
This issue does not follow our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
NAPI FATAL ERROR: Error::New napi_create_errorpanic in Bun runtime (Windows, but same root cause)If you believe this was flagged incorrectly, please let a maintainer know.
mskadu commentedon Jun 16, 2026
Closing as a duplicate of #31563 — same platform (macOS Apple Silicon), same embedded Bun 1.3.14, same crash-on-exit with trace trap. #31563 was filed first with more detail. The upstream Bun fix is tracked at oven-sh/bun#32144.
mskadu commentedon Jun 16, 2026
Closing as duplicate of #31563