Unhandled Promise Rejection: Bad substitution: chunks[1].startOffset
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 活躍
- 技術堆疊
- bash, node.js
- 領域
- cli
研究方向
從呼叫 shell-quote 的命令解析路徑開始,接著檢查堆疊追蹤中的 parse.js 位置,以及周圍的 promise 錯誤處理。找出一個會觸發替換失敗的輸入,並驗證該命令要麼能夠執行,要麼產生一個已處理且清楚的驗證錯誤,而不是未處理的拒絕。
由索引模型根據 Issue 內容生成。
描述
Summary
Command Code crashes with an unhandled promise rejection when parsing a shell command.
Environment:
- OS: Ubuntu Linux
- Node.js: v22.20.0
- Command Code: latest installed version
- Shell: [bash/zsh/etc.]
Error:
CRITICAL: Unhandled Promise Rejection!
This is an unexpected error. Please file a bug report.
ERROR: Error
REASON → Bad substitution: chunks[1].startOffset
Stack trace:
Error: Bad substitution: chunks[1].startOffset
at parseEnvVar (.../command-code/node_modules/shell-quote/parse.js:171:12)
at .../command-code/node_modules/shell-quote/parse.js:256:17
at Array.map ()
at parseInternal (.../command-code/node_modules/shell-quote/parse.js:113:17)
at parse (.../command-code/node_modules/shell-quote/parse.js:309:15)
...
Trace ID:
c58b9fbd1d12acef3534f9db896e4142
The error appears to originate while parsing the shell command/environment
variable substitution through the shell-quote dependency.
Expected Behavior
The command should either execute normally or return a handled/clear
validation error rather than crashing with an unhandled promise rejection.
Actual Behavior
The command should either execute normally.
Steps to reproduce the issue
The issue doesn’t require reproduction.
Command Code Version
1.53.0
Operating System
Linux
Terminal/IDE
Terminal
Shell
bash
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
This was reproduced on Ubuntu with Node.js v22.20.0.
- 主要語言
- 沒有語言資料
- 星號
- 4k
- 分支
- 350
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CommandCodeAI/command-code 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#855 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
CommandCodeAI/command-code#841 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#655 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#608 ·
-
難度 3/5 1-2 天 新手友好度 70/100
CommandCodeAI/command-code#893 ·
查看 CommandCodeAI/command-code 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 92/100
milvus-io/birdwatcher#545 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
-
area:tools bug good first issue help wanted priority:P2
難度 2/5 1-3 小時 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
caddyserver/caddy#8046 ·