CLI Crash: [API Error: Cannot read properties of undefined (reading 'error')] triggered by AbortError
What happened?
While using the CLI, the application crashed with an "API Error". Looking at the Debug Console, it appears to be triggered by an AbortError (The user aborted a request), followed by a React state update error (Cannot update a component...).
Error Output:
1 > ✕ [API Error: Cannot read properties of undefined (reading 'error')]
2 >
3 > Debug Console:
4 > error: AbortError: The user aborted a request.
5 > at abort (...\node-fetch\lib\index.js:1458:16)
6 > ...
7 > ✖ Cannot update a component (`InputPrompt`) while rendering a different component (`AppContainer`).
8 > ```
9
10 ---
What did you expect to happen?
The CLI should handle the request abort/cancellation gracefully without crashing the entire application or throwing an unhandled exception regarding undefined properties.
Client information
- CLI Version: 0.18.4
- Git Commit: 2e8d7831c
- Session ID: 2fb14ac7-ee3a-4218-ac9e-504ee4279d31
- Operating System: win32 v24.11.1
- Sandbox Environment: no sandbox
- Model Version: auto
- Memory Usage: 268.9 MB
Login information
Google Account (ADC / gcloud)
Anything else we need to know?
Environment:
- OS: Windows (win32)
- Node Version: v24.11.1 (observed in the stack trace path)
- CLI Path: C:\ProgramData\nvm\v24.11.1\node_modules@google\gemini-cli
Full Stack Trace:
1 > error: AbortError: The user aborted a request.
2 > at abort (C:\ProgramData\nvm\v24.11.1\node_modules\@google\gemini-cli\node_modules\node-fetch\lib\index.js:1458:16)
3 > at AbortSignal.abortAndFinalize
4 > (C:\ProgramData\nvm\v24.11.1\node_modules\@google\gemini-cli\node_modules\node-fetch\lib\index.js:1473:4)
5 > at [nodejs.internal.kHybridDispatch] (node:internal/event_target:845:20)
6 > at AbortSignal.dispatchEvent (node:internal/event_target:778:26)
7 > at runAbort (node:internal/abort_controller:488:10)
8 > at abortSignal (node:internal/abort_controller:459:3)
9 > at AbortController.abort (node:internal/abort_controller:507:5)
10 > at file:///C:/ProgramData/nvm/v24.11.1/node_modules/@google/gemini-cli/dist/src/ui/hooks/useGeminiStream.js:160:36 11 > at file:///C:/ProgramData/nvm/v24.11.1/node_modules/@google/gemini-cli/dist/src/ui/AppContainer.js:763:35 12 > at file:///C:/ProgramData/nvm/v24.11.1/node_modules/@google/gemini-cli/dist/src/ui/contexts/KeypressContext.js:499:77 13 > ``` 14 15 --- 16
Found possible duplicate issues:
- #3624
- #7699
- #10952
- #13000
- #10865
If you believe this is not a duplicate, please remove the status/possible-duplicate label.
I am having the same issue as well. On the latest version of Gemini CLI.
me too, how to fix this ?
I spotted how to fix it. I will submit a PR soon.