CRITICAL: Unhandled Promise Rejection ERROR Bad substitution: ${}
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 活躍
- 技術堆疊
- javascript, node.js, shell
- 領域
- cli
研究方向
Start by reproducing the failure while testing web URLs in Command Code v1.66.0 on WSL, then inspect node_modules/shell-quote/parse.js around parseEnvVar and the classify, isReadonlyShellCommand, and shellPermissionRulesForCommand entry points shown in the stack. Done means the command completes with its expected result instead of producing an unhandled Promise rejection for Bad substitution: ${}.
由索引模型根據 Issue 內容生成。
描述
Summary
Hi,
the cmdc cli unexpectedly stopped by below error:
ERROR Bad substitution: ${}
.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:157:12
154: if (char === '{') {
155: i += 1;
156: if (s.charAt(i) === '}') {
157: throw new Error('Bad substitution: ' + s.slice(i - 2, i + 1));
158: }
159: // match braces by depth so a nested `${` keeps its inner `}` from ending the outer substitution
160: var depth = 1;
- parseEnvVar (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:157:12)
- (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:256:17)
- at Array.map (<anonymous>)\t
- parseInternal (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:113:17)
- parse (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:309:15)
- classify (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:400892)
- isReadonlyShellCommand (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:406691)
- shellPermissionRulesForCommand (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:1116296)
- getShellPermissionChoices (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:1124280)
- ShellPermissionPrompt (.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:16:21508)
✖ CRITICAL: Unhandled Promise Rejection!
This is an unexpected error. Please file a bug report at https://github.com/CommandCodeAI/command-code/issues/new
✖ ERROR → Error
ℹ REASON → Bad substitution: ${}
ℹ ERROR STACK ↓
Error: Bad substitution: ${}
at parseEnvVar (/home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:157:12)
at /home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:256:17
at Array.map (<anonymous>)
at parseInternal (/home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:113:17)
at parse (/home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:309:15)
at classify (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:400892)
at isReadonlyShellCommand (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:406691)
at shellPermissionRulesForCommand (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:1116296)
at getShellPermissionChoices (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:1124280)
at ShellPermissionPrompt (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:16:21508)
ℹ Trace ID: 25b5e46aee64eda322ee6bd2eef4fe44
Share this ID with support to help debug your issue.
Expected Behavior
Complete the cmd and give expected result. But stopped by ✖ CRITICAL: Unhandled Promise Rejection!
Actual Behavior
✖ CRITICAL: Unhandled Promise Rejection!
This is an unexpected error. Please file a bug report at https://github.com/CommandCodeAI/command-code/issues/new
✖ ERROR → Error
ℹ REASON → Bad substitution: ${}
ℹ ERROR STACK ↓
Error: Bad substitution: ${}
at parseEnvVar (/home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:157:12)
at /home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:256:17
at Array.map (<anonymous>)
at parseInternal (/home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:113:17)
at parse (/home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/node_modules/shell-quote/parse.js:309:15)
at classify (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:400892)
at isReadonlyShellCommand (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:406691)
at shellPermissionRulesForCommand (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:1116296)
at getShellPermissionChoices (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:2:1124280)
at ShellPermissionPrompt (file:///home/bug/.nvm/versions/node/v24.18.0/lib/node_modules/command-code/dist/cli.mjs:16:21508)
Steps to reproduce the issue
- I try to: use all skills one by one and find vulnerabilities on this https://readact.com site
- cmdc crushed while testing web URLs.
Command Code Version
v1.66.0
Operating System
Linux
Terminal/IDE
wsl
Shell
wsl
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
No response
- 主要語言
- 沒有語言資料
- 星號
- 4k
- 分支
- 357
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CommandCodeAI/command-code 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#933 ·
-
難度 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 ·
查看 CommandCodeAI/command-code 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
objectionary/eolang.sty#167 ·
-
documentation
難度 1/5 1 小時以內 新手友好度 92/100
githubnext/gh-aw-workshop#3968 ·
維護者通常 1 天內回覆
-
triage/confirmed
難度 2/5 1-3 小時 新手友好度 78/100
agentscope-ai/agentscope#2987 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 90/100
HexRaysSA/ida-hcli#368 · 2 則留言 ·
維護者通常 1 天內回覆
-
chore tests
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆