CommandCodeAI / CommandCodeAI/command-code
Invalid hook call mid-session
未關閉
@vipulgupta2048 已經在處理了。
開始於 2026年6月30日。
- 主要語言
- 沒有語言資料
- 星號
- 4k
- 分支
- 350
- PR 合併指標
- 30 天內沒有已合併 PR
描述
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
- Run command-code via
bunx - Prompt the LLM to do something
- Errors after waiting for some time.
Command Code Version
0.40.14
Operating System
macOS
Terminal/IDE
zed
Shell
zsh
Additional context
No response
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
評估
這個 Issue 還沒有評估資料。