CommandCodeAI / CommandCodeAI/command-code

Invalid hook call mid-session

Offen
#539 3 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@vipulgupta2048 arbeitet bereits daran.

Seit 30.6.2026.

Vorherrschende Sprache
Keine Sprachdaten
Sterne
4k
Forks
350
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Summary

Command Code (ran via bunx command-code raises "ERROR Cannot read properties of null (reading 'useState')" mid-session all the time. Whether it's reasoning, calling tools or anything else.

Expected Behavior

The session should go on properly.

Actual Behavior

Stack trace:

Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.

  ERROR  Cannot read properties of null (reading 'useState')

 /Users/harrow/.bun/install/global/node_modules/react/cjs/react.development.js:1221:33

 1218:       return resolveDispatcher().useRef(initialValue);
 1219:     };
 1220:     exports.useState = function (initialState) {
 1221:       return resolveDispatcher().useState(initialState);
 1222:     };
 1223:     exports.useSyncExternalStore = function (
 1224:       subscribe,

 -process.env.NODE_ENV.exports.useS (/Users/harrow/.bun/install/global/node_modules/react/cjs/react.development.
  ate                              js:1221:33)
 -SelectInput
             (file:///Users/harrow/.bun/install/global/node_modules/ink-select-input/build/SelectInput.js:11:43)

 -Object.react_stack_botto (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_mo
  _frame                  dules/react-reconciler/cjs/react-reconciler.development.js:17596:20)
 -renderWithHoo (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react
  s            -reconciler/cjs/react-reconciler.development.js:5335:22)
 -updateFunctionCompo (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules
  ent                /react-reconciler/cjs/react-reconciler.development.js:7720:19)
 -beginWork (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-rec
           onciler/cjs/react-reconciler.development.js:9277:18)
 -runWithFiberInD (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/rea
  V              ct-reconciler/cjs/react-reconciler.development.js:2505:30)
 -performUnitOfWo (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/rea
  k              ct-reconciler/cjs/react-reconciler.development.js:15273:22)
 -workLoopSyn (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-r
             econciler/cjs/react-reconciler.development.js:15099:41)
 -renderRootSy (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-
  c           reconciler/cjs/react-reconciler.development.js:15080:11)


✖ CRITICAL: Unhandled Promise Rejection!
This is an unexpected error. Please file a bug report at https://github.com/CommandCodeAI/command-code/issues/new
✖ ERROR → TypeError
ℹ REASON → Cannot read properties of null (reading 'useState')
ℹ ERROR STACK ↓
 TypeError: Cannot read properties of null (reading 'useState')
    at process.env.NODE_ENV.exports.useState (/Users/harrow/.bun/install/global/node_modules/react/cjs/react.development.js:1221:33)
    at SelectInput (file:///Users/harrow/.bun/install/global/node_modules/ink-select-input/build/SelectInput.js:11:43)
    at Object.react_stack_bottom_frame (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:17596:20)
    at renderWithHooks (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:5335:22)
    at updateFunctionComponent (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:7720:19)
    at beginWork (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:9277:18)
    at runWithFiberInDEV (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:2505:30)
    at performUnitOfWork (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:15273:22)
    at workLoopSync (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:15099:41)
    at renderRootSync (/Users/harrow/.bun/install/global/node_modules/command-code/node_modules/ink/node_modules/react-reconciler/cjs/react-reconciler.development.js:15080:11)

ℹ Trace ID: d82d586c31909e4ba87bec83b7278a5d
  Share this ID with support to help debug your issue.
Steps to reproduce the issue
  1. Run command-code via bunx
  2. Prompt the LLM to do something
  3. Errors after waiting for some time.
Command Code Version

0.40.14

Operating System

macOS

Terminal/IDE

zed

Shell

zsh

Additional context

No response

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.