Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

CRITICAL: Unhandled Promise Rejection ERROR Bad substitution: ${}

未關閉
#934 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 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
  1. I try to: use all skills one by one and find vulnerabilities on this https://readact.com site
  2. 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,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CommandCodeAI/command-code 的其他 Issue

查看 CommandCodeAI/command-code 的全部 Issue

相似的 Issue

更多 CLI Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。