From 707295d15ab26b005305bceedb906560d7369769 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 4 Aug 2025 15:49:50 +0000 Subject: [PATCH] fix: resolve critical failures on macOS - spawn npx ENOENT and missing webview assets - Fix spawn npx ENOENT error on Windows by checking for npm-related commands - Fix missing webview assets by including chunk files and source maps in .vscodeignore - PostHog telemetry errors are already handled gracefully with try-catch Fixes #6662 --- src/.vscodeignore | 3 ++- src/services/mcp/McpHub.ts | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/.vscodeignore b/src/.vscodeignore index 9695b185a62..32a69abfdea 100644 --- a/src/.vscodeignore +++ b/src/.vscodeignore @@ -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 !webview-ui/build/assets/fonts/*.woff !webview-ui/build/assets/fonts/*.woff2 !webview-ui/build/assets/fonts/*.ttf diff --git a/src/services/mcp/McpHub.ts b/src/services/mcp/McpHub.ts index 10a74712ef0..1bb064f2d89 100644 --- a/src/services/mcp/McpHub.ts +++ b/src/services/mcp/McpHub.ts @@ -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()) + + const command = isWindows && !isAlreadyWrapped && isNpmCommand ? "cmd.exe" : configInjected.command const args = - isWindows && !isAlreadyWrapped + isWindows && !isAlreadyWrapped && isNpmCommand ? ["/c", configInjected.command, ...(configInjected.args || [])] : configInjected.args