claude-code - 💡(How to fix) Fix claude --resume / --continue crashes: `g78 is not a function` (v2.1.119, v2.1.120) [2 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#53226Fetched 2026-04-26 05:21:08
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
0
Timeline (top)
labeled ×6commented ×2closed ×1cross-referenced ×1

claude --resume <session> crashes on startup before any UI renders, with g78 is not a function thrown from a useEffect in the REPL component. The crash also reproduces with --continue if there are persisted messages to restore.

Reproduces on 2.1.119 and 2.1.120 (native Linux installer). Not yet tested on 2.1.118.

Error Message

ERROR g78 is not a function. (In 'g78(z)', 'g78' is undefined) Hard-blocks --resume and --continue for any user on next channel since 2.1.119. The error message also leaks a giant minified stack into the terminal, which is noisy and consumes input tokens on the next session restart.

Root Cause

In the bundled cli.js, the REPL component does:

let S = sq.useMemo(() => !1, []);   // hardcoded false — feature flag for some remote-session mode
...
let { onBeforeQuery: F78, onTurnComplete: vv8, onSessionRestored: g78,
      render: sWq, ownsInput: Vv8 } = Cf9({ enabled: S, setMessages: F4, ... });

Cf9({ enabled: false, ... }) returns an object where onSessionRestored is undefined.

Then a few hundred lines later, in the mount effect that processes initial messages:

sq.useEffect(() => {
  if (z && z.length > 0) {
    K2q(z, zK()),
    y$K({ abortController: new AbortController, taskRegistry: $8 }),
    eCK(z),
    Bc(z),
    t$8.current.current = uwq(z, gK),
    g78(z);                 // <-- crashes when g78 (onSessionRestored) is undefined
  }
}, []);

The call site is not guarded by enabled/feature flag. It is invoked unconditionally whenever there are initial messages — i.e. every --resume and every --continue with prior messages.

Fix Action

Fix / Workaround

Workaround used locally

Binary patch on ~/.local/share/claude/versions/2.1.120 — same-length replacement of g78(z) with void 0 (matches the intended no-op when the feature flag is off). Two occurrences in the bundle.

Code Example

ERROR  g78 is not a function. (In 'g78(z)', 'g78' is undefined)

 /$bunfs/root/src/entrypoints/cli.js:9247:5663

 - <anonymous> (cli.js:9247:5663)
 - WC (cli.js:492:63749)
 - pT (cli.js:492:76948)
 - MY (cli.js:492:76827)
 - pT (cli.js:492:77745)  [repeats]
 - async <anonymous> (cli.js:18811:2361)

---

let S = sq.useMemo(() => !1, []);   // hardcoded false — feature flag for some remote-session mode
...
let { onBeforeQuery: F78, onTurnComplete: vv8, onSessionRestored: g78,
      render: sWq, ownsInput: Vv8 } = Cf9({ enabled: S, setMessages: F4, ... });

---

sq.useEffect(() => {
  if (z && z.length > 0) {
    K2q(z, zK()),
    y$K({ abortController: new AbortController, taskRegistry: $8 }),
    eCK(z),
    Bc(z),
    t$8.current.current = uwq(z, gK),
    g78(z);                 // <-- crashes when g78 (onSessionRestored) is undefined
  }
}, []);
RAW_BUFFERClick to expand / collapse

claude --resume <id> crashes immediately: g78 is not a function (v2.1.119, v2.1.120)

Summary

claude --resume <session> crashes on startup before any UI renders, with g78 is not a function thrown from a useEffect in the REPL component. The crash also reproduces with --continue if there are persisted messages to restore.

Reproduces on 2.1.119 and 2.1.120 (native Linux installer). Not yet tested on 2.1.118.

Repro

  1. Have any project with persisted session messages (e.g. a recently-used session in ~/.claude/projects/<slug>/<uuid>.jsonl).
  2. Run claude --resume "<label-or-id>" (also reproduces with claude --continue).
  3. Crash before the TUI mounts.

Stack trace (2.1.120)

ERROR  g78 is not a function. (In 'g78(z)', 'g78' is undefined)

 /$bunfs/root/src/entrypoints/cli.js:9247:5663

 - <anonymous> (cli.js:9247:5663)
 - WC (cli.js:492:63749)
 - pT (cli.js:492:76948)
 - MY (cli.js:492:76827)
 - pT (cli.js:492:77745)  [repeats]
 - async <anonymous> (cli.js:18811:2361)

Root cause

In the bundled cli.js, the REPL component does:

let S = sq.useMemo(() => !1, []);   // hardcoded false — feature flag for some remote-session mode
...
let { onBeforeQuery: F78, onTurnComplete: vv8, onSessionRestored: g78,
      render: sWq, ownsInput: Vv8 } = Cf9({ enabled: S, setMessages: F4, ... });

Cf9({ enabled: false, ... }) returns an object where onSessionRestored is undefined.

Then a few hundred lines later, in the mount effect that processes initial messages:

sq.useEffect(() => {
  if (z && z.length > 0) {
    K2q(z, zK()),
    y$K({ abortController: new AbortController, taskRegistry: $8 }),
    eCK(z),
    Bc(z),
    t$8.current.current = uwq(z, gK),
    g78(z);                 // <-- crashes when g78 (onSessionRestored) is undefined
  }
}, []);

The call site is not guarded by enabled/feature flag. It is invoked unconditionally whenever there are initial messages — i.e. every --resume and every --continue with prior messages.

Suggested fix

Either:

  • Make Cf9 always return a no-op onSessionRestored when enabled is false (defensive default), or
  • Guard the call site: g78 && g78(z) (or g78?.(z)).

The second is a one-character fix.

Workaround used locally

Binary patch on ~/.local/share/claude/versions/2.1.120 — same-length replacement of g78(z) with void 0 (matches the intended no-op when the feature flag is off). Two occurrences in the bundle.

Environment

  • Platform: Linux 6.12.75+rpt-rpi-2712 (Raspberry Pi 5)
  • Shell: bash
  • Claude Code: 2.1.120 (native installer, Bun-bundled binary)
  • Also reproduced on: 2.1.119
  • npm dist-tags at time of report: stable: 2.1.112, next: 2.1.119, latest: 2.1.119

Impact

Hard-blocks --resume and --continue for any user on next channel since 2.1.119. The error message also leaks a giant minified stack into the terminal, which is noisy and consumes input tokens on the next session restart.

extent analysis

TL;DR

The most likely fix is to guard the call site of g78(z) with a null check, such as g78 && g78(z) or g78?.(z), to prevent the crash when g78 is undefined.

Guidance

  • The issue is caused by the g78 function being undefined when the enabled flag is false, and the call site is not guarded.
  • To verify the fix, run claude --resume <session> and check if the crash is resolved.
  • The suggested fix can be applied by modifying the useEffect hook in the REPL component to include a null check for g78.
  • An alternative fix is to make Cf9 return a no-op onSessionRestored when enabled is false.

Example

sq.useEffect(() => {
  if (z && z.length > 0) {
    // ...
    g78 && g78(z); // or g78?.(z)
  }
}, []);

Notes

The fix assumes that the g78 function is not necessary when the enabled flag is false. If this is not the case, a more complex fix may be required.

Recommendation

Apply the workaround by guarding the call site with a null check, such as g78 && g78(z) or g78?.(z), as it is a simple and effective solution to prevent the crash.

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