CRITICAL: Unhandled Promise Rejection ERROR Bad substitution: ${}
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- javascript, node.js, shell
- Domain
- cli
Research direction
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: ${}.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- No language data
- Stars
- 4k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CommandCodeAI/command-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#933 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#855 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CommandCodeAI/command-code#841 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#655 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#608 ·
All issues in CommandCodeAI/command-code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
prisma/prisma-cli#309 ·
Maintainers usually reply within 1 day
-
agent-reported area/docs area/server documentation good first issue hacktoberfest help wanted P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
area:evidence criticality:p3 triage:needs-implementation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
registrystack/registry-stack#1620 ·
Maintainers usually reply within 1 day
-
area:ai-suggestions bug good first issue P2
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
uttrflow/uttrflow-swift#1889 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openvinotoolkit/openvino_notebooks#3665 ·
Maintainers usually reply within 1 day