[BUG] BUN crash - **panic**: switch on corrupt value

Resolved 💬 3 comments Opened Feb 20, 2026 by stentas Closed Feb 23, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I see there are other BUN crashes, butthey are for v1.3.9. Thisis for v1.3.10

Cause
Claude Code crashed due to a bug in the Bun runtime (switch on corrupt value). The crash originated in Bun's internal memory cleanup during a filesystem operation (node_fs.zig → deinitAndUnprotect), where Bun encountered an invalid internal state and panicked intentionally rather than continuing with corrupted memory.

Impact
No code or files on disk were affected.
Only unsaved in-session changes may have been lost at the time of the crash.

Bug report

What Should Happen?

It should work....

Error Messages/Logs

Bun v1.3.10 ([`1423d3c`](<https://github.com/oven-sh/bun/tree/1423d3c8270c186df5dacd017370e51efff39acd>)) on windows x86_64_baseline [_]

**panic**: switch on corrupt value

- [`string.zig:885`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/string.zig#L885>): `deref`
- [`node_fs.zig:2286`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/bun.js/node/node_fs.zig#L2286>): `deinitAndUnprotect`
- [`event_loop.zig:501`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/bun.js/event_loop.zig#L501>): `tick`
- [`VirtualMachine.zig:770`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/bun.js/VirtualMachine.zig#L770>): `eventLoop`
- [`bindings.cpp:4686`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/bun.js/bindings/bindings.cpp#L4686>): `JSC__VM__holdAPILock`
- [`VM.zig:35`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/bun.js/bindings/VM.zig#L35>): `holdAPILock`
- [`cli.zig:20`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/cli.zig#L20>): `start`
- [`main.zig:62`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/main.zig#L62>): `main`
- [`exe_common.inl:78`](<https://github.com/oven-sh/bun/blob/1423d3c8270c186df5dacd017370e51efff39acd/src/src/startup/exe_common.inl#L78>): `invoke_main`

Steps to Reproduce

It comes sporadically

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.49

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗