Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
!dist

# Include the built webview
!**/*.map
!webview-ui/audio
!webview-ui/build/assets/*.js
!webview-ui/build/assets/*.map
!webview-ui/build/assets/*.ttf
!webview-ui/build/assets/*.css
!webview-ui/build/assets/chunk-*.js
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern chunk-*.js should catch the missing file, but the error shows chunk-pO14Kfwb.js wasn't found. Is it possible the build process generates these files with a different pattern or in a different location? We should verify that all webpack chunk files are actually matching this pattern.

!webview-ui/build/assets/fonts/*.woff
!webview-ui/build/assets/fonts/*.woff2
!webview-ui/build/assets/fonts/*.ttf
Expand Down
7 changes: 5 additions & 2 deletions src/services/mcp/McpHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,12 @@ export class McpHub {
const isAlreadyWrapped =
configInjected.command.toLowerCase() === "cmd.exe" || configInjected.command.toLowerCase() === "cmd"

const command = isWindows && !isAlreadyWrapped ? "cmd.exe" : configInjected.command
// Check if the command is npx or other npm-related commands that might be scripts
const isNpmCommand = ["npx", "npm", "pnpm", "yarn"].includes(configInjected.command.toLowerCase())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is for Windows but the issue (#6662) is on macOS. The ENOENT error happens because npx isn't found in PATH on macOS, not because it needs cmd.exe wrapping. Could we instead:

  1. Check if the command exists in PATH before executing
  2. Provide better error messages when commands aren't found
  3. Add platform-specific handling for macOS (e.g., checking common npm installation paths)?


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're already modifying this area, should we add better error handling for the macOS case? Something like:

Suggested change
// Check if the command is npx or other npm-related commands that might be scripts
const isNpmCommand = ["npx", "npm", "pnpm", "yarn"].includes(configInjected.command.toLowerCase())
// On macOS, check if npm commands exist in PATH
if (process.platform === "darwin" && isNpmCommand) {
const commandExists = await checkCommandExists(configInjected.command)
if (!commandExists) {
throw new Error(`Command '${configInjected.command}' not found in PATH. Please ensure Node.js and npm are properly installed.`)
}
}

const command = isWindows && !isAlreadyWrapped && isNpmCommand ? "cmd.exe" : configInjected.command
const args =
isWindows && !isAlreadyWrapped
isWindows && !isAlreadyWrapped && isNpmCommand
? ["/c", configInjected.command, ...(configInjected.args || [])]
: configInjected.args

Expand Down
Loading