claude-code - 💡(How to fix) Fix claude --resume crashes with "FKH is not a function" on v2.1.120 [1 comments, 2 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#53274Fetched 2026-04-26 05:19:54
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

ERROR  FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)
  B:/~BUN/root/src/entrypoints/cli.js:9273:5663

Root Cause

Root cause (analyzed)

onSessionRestored (mangled as FKH) is destructured from XJ7({enabled: S, ...}) where S is always false in CLI mode (const S = useMemo(() => false, [])). The function returns undefined for that callback, but it is called unconditionally when initialMessages (K) has length > 0 during session restoration:

Code Example

ERROR  FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)
  B:/~BUN/root/src/entrypoints/cli.js:9273:5663

---

useEffect(() => {
  if (K && K.length > 0)
    sW8(K, Kq()), GMq(...), BIq(K), pc(K), oMH.current.current = I38(K, Fq), FKH(K)  // FKH is undefined
}, []);
RAW_BUFFERClick to expand / collapse

Version: 2.1.120 (Claude Code) Platform: Windows 11 Home, PowerShell

Steps to reproduce

  1. Have a previous Claude Code session
  2. Run claude --resume from the terminal

Error

ERROR  FKH is not a function. (In 'FKH(K)', 'FKH' is undefined)
  B:/~BUN/root/src/entrypoints/cli.js:9273:5663

Root cause (analyzed)

onSessionRestored (mangled as FKH) is destructured from XJ7({enabled: S, ...}) where S is always false in CLI mode (const S = useMemo(() => false, [])). The function returns undefined for that callback, but it is called unconditionally when initialMessages (K) has length > 0 during session restoration:

useEffect(() => {
  if (K && K.length > 0)
    sW8(K, Kq()), GMq(...), BIq(K), pc(K), oMH.current.current = I38(K, Fq), FKH(K)  // FKH is undefined
}, []);

Expected behavior

Session resumes normally.

Actual behavior

CLI crashes immediately on --resume — session cannot be restored.

extent analysis

TL;DR

The issue can be fixed by ensuring FKH is defined before calling it, likely by adding a conditional check to prevent calling FKH when it's undefined.

Guidance

  • Verify that FKH is indeed undefined by adding a console log or debugger statement before the line where FKH is called.
  • Check the XJ7 function to see why FKH is not being returned when S is false.
  • Consider adding a conditional statement to check if FKH is defined before calling it, e.g., if (FKH) FKH(K).
  • Review the useMemo hook to see if the dependency array is correct, as S is always false in CLI mode.

Example

useEffect(() => {
  if (K && K.length > 0)
    sW8(K, Kq()), GMq(...), BIq(K), pc(K), oMH.current.current = I38(K, Fq), 
    if (FKH) FKH(K)  // Add a conditional check
}, []);

Notes

The issue seems to be related to the XJ7 function not returning FKH when S is false. Without the implementation of XJ7, it's difficult to provide a more specific fix.

Recommendation

Apply workaround: Add a conditional check to prevent calling FKH when it's undefined, as shown in the example above. This will prevent the CLI from crashing, but the root cause of FKH being undefined still needs to be investigated.

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…

FAQ

Expected behavior

Session resumes normally.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING