Crash: undefined is not an object (evaluating 'U.length') in React reconciler
Description
Claude Code crashes with a React internal error during normal usage. The error occurs in the terminal UI rendering layer (React/Ink).
Error
ERROR undefined is not an object (evaluating 'U.length')
/$bunfs/root/claude:685:20565
Stack trace
- i$ (/$bunfs/root/claude:685:20565)
- gJ (/$bunfs/root/claude:685:28719)
- nG (/$bunfs/root/claude:685:28873)
- I1 (/$bunfs/root/claude:685:25085)
- <anonymous> (/$bunfs/root/claude:191:9236)
- WR (/$bunfs/root/claude:3623:4221)
- x_0 (/$bunfs/root/claude:7325:12534)
- k$T (/$bunfs/root/claude:7338:10259)
- R$ (/$bunfs/root/claude:685:20775)
- V6 (/$bunfs/root/claude:685:39175)
The crash appears to originate in React's useSyncExternalStore hook (I1), called from a component's effect (nG = useEffect), during the reconciliation phase (i$ = hook comparison, gJ = effect update).
Environment
- OS: macOS Darwin 25.2.0 (Apple Silicon, Mac Mini M4 Pro)
- Shell: zsh
- Claude Code: latest (installed via Homebrew/bun)
- Model: claude-opus-4-6
Steps to reproduce
Not reliably reproducible. Occurred during a normal interactive session. The crash forced a restart of Claude Code.
Expected behavior
Claude Code should not crash with React internal errors during normal usage.
Additional context
The minified React code in the stack trace corresponds to React's fiber reconciler — specifically the hooks system (useSyncExternalStore, useEffect, hook dependency comparison). The U.length evaluation suggests a hooks dependency array or similar array parameter was undefined when expected to be an array.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗