[BUG] `claude --resume <session-id>` crashes with: ERROR UKH is not a function. (In 'UKH(K)', 'UKH' is undefined)
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?
Title: crash: UKH (onSessionRestored) is not a function when using --resume
Body:
## Description
claude --resume <session-id> crashes with:
ERROR UKH is not a function. (In 'UKH(K)', 'UKH' is undefined)
## Steps to Reproduce
claude --resume <session-id>
## Root Cause
In the REPL component, RW4 is called with enabled: false (hardcoded via
let I = useMemo(() => false, [])). When disabled, RW4 returns
onSessionRestored: undefined.
On mount, when initialMessages are present (as they are during --resume),
the component unconditionally calls UKH(K) without guarding for undefined:
s$.useEffect(() => {
if (K && K.length > 0)
..., UKH(K) // crashes: UKH is undefined when RW4 is disabled
}, [])
## Fix
Either guard the call (UKH?.(K)) or have RW4 return a no-op stub instead
of undefined when enabled is false.
What Should Happen?
Either guard the call (UKH?.(K)) or have RW4 return a no-op stub instead
of undefined when enabled is false.
Error Messages/Logs
Steps to Reproduce
Looking at the crash, the bug is clear from the minified source.
The problem: UKH (aliased as onSessionRestored) is undefined when called.
Here's the chain:
- I is initialized as permanently false:
let I = s$.useMemo(() => !1, [])
- RW4 is called with enabled: I (i.e., enabled: false):
let {onBeforeQuery:FKH, onTurnComplete:vvH, onSessionRestored:UKH, ...} = RW4({enabled: I, ...})
- When enabled is false, RW4 returns onSessionRestored: undefined instead of a function.
- The useEffect that runs on mount unconditionally calls UKH(K) when initialMessages exist:
s$.useEffect(() => {
if (K && K.length > 0)
..., UKH(K) // ← crashes: UKH is undefined
}, [])
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.120
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
in ssh terminal on latest debian with claude code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗