claude-code - 💡(How to fix) Fix [Bug] claude --resume crashes with "FKH is not a function" in v2.1.120 [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53099Fetched 2026-04-25 06:12:22
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
3
Author
Timeline (top)
commented ×2cross-referenced ×2

Error Message

Running claude -r (or claude --resume) crashes immediately with a JavaScript error: Fatal crash with the following error: ERROR FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)

  • The error occurs before any user configuration is read, so it is unrelated to local settings

Root Cause

Root Cause (Analysis)

Fix Action

Fix / Workaround

  • This is a regression from v2.1.119 (working) → v2.1.120 (broken)
  • Workaround: start a new session manually, resume is completely broken
  • The error occurs before any user configuration is read, so it is unrelated to local settings

Code Example

ERROR  FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)

B:/~BUN/root/src/entrypoints/cli.js:9273:5663

---

- <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9273:5663)
- PI (B:/~BUN/root/src/entrypoints/cli.js:512:63749)
- Fw (B:/~BUN/root/src/entrypoints/cli.js:512:76948)
- P5 (B:/~BUN/root/src/entrypoints/cli.js:512:76827)

---

{onBeforeQuery:UKH, onTurnComplete:LVH, onSessionRestored:FKH, render:iW8, ownsInput:ZVH} = XJ7({enabled:S, ...})

---

s8.useEffect(() => {
  if (K && K.length > 0) ..., FKH(K)  // called without null-check
}, []);
RAW_BUFFERClick to expand / collapse

Bug Description

Running claude -r (or claude --resume) crashes immediately with a JavaScript error: FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)

Environment

  • Claude Code version: 2.1.120
  • OS: Windows 11 Pro 10.0.26200
  • Shell: cmd / bash

Steps to Reproduce

  1. Have an existing Claude Code session with conversation history
  2. Run claude -r or claude --resume
  3. Crash occurs immediately on startup

Expected Behavior

Session resumes normally.

Actual Behavior

Fatal crash with the following error:

ERROR  FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)

B:/~BUN/root/src/entrypoints/cli.js:9273:5663

Stack trace:

- <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:9273:5663)
- PI (B:/~BUN/root/src/entrypoints/cli.js:512:63749)
- Fw (B:/~BUN/root/src/entrypoints/cli.js:512:76948)
- P5 (B:/~BUN/root/src/entrypoints/cli.js:512:76827)

Root Cause (Analysis)

FKH is the onSessionRestored callback destructured from XJ7(...):

{onBeforeQuery:UKH, onTurnComplete:LVH, onSessionRestored:FKH, render:iW8, ownsInput:ZVH} = XJ7({enabled:S, ...})

Where S = useMemo(() => false, []). When the feature is disabled, XJ7 returns undefined for onSessionRestored, but the code calls it unconditionally when initial messages (K) are present:

s8.useEffect(() => {
  if (K && K.length > 0) ..., FKH(K)  // called without null-check
}, []);

Additional Notes

  • This is a regression from v2.1.119 (working) → v2.1.120 (broken)
  • Workaround: start a new session manually, resume is completely broken
  • The error occurs before any user configuration is read, so it is unrelated to local settings

extent analysis

TL;DR

The most likely fix is to add a null-check for the FKH function before calling it to prevent the crash when the feature is disabled.

Guidance

  • Verify that the issue is indeed caused by the missing null-check for FKH by checking the XJ7 function return value when the feature is disabled.
  • Add a null-check for FKH before calling it, e.g., if (FKH) FKH(K).
  • Review the XJ7 function to ensure it returns the expected values for onSessionRestored when the feature is enabled or disabled.
  • Consider adding a default value or a fallback for FKH when it is undefined to prevent similar issues in the future.

Example

s8.useEffect(() => {
  if (K && K.length > 0) {
    if (FKH) FKH(K); // add null-check
  }
}, []);

Notes

The provided analysis suggests that the issue is a regression introduced in version 2.1.120, and the workaround is to start a new session manually. The fix should be applied to the claude codebase to prevent the crash when resuming a session.

Recommendation

Apply the workaround by adding a null-check for FKH before calling it, as this is a straightforward fix that can prevent the crash without requiring a full version upgrade.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] claude --resume crashes with "FKH is not a function" in v2.1.120 [2 comments, 3 participants]