CommandCodeAI / CommandCodeAI/command-code
Invalid hook call mid-session
Đang mở
@vipulgupta2048 đang làm issue này rồi.
Từ ngày 30/6/2026.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4k
- Fork
- 350
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.