-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: resolve critical failures on macOS - spawn npx ENOENT and missing webview assets #6663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…g 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own code is like debugging in production - technically possible but morally questionable.
|
|
||
| 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()) |
There was a problem hiding this comment.
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:
- Check if the command exists in PATH before executing
- Provide better error messages when commands aren't found
- Add platform-specific handling for macOS (e.g., checking common npm installation paths)?
| !webview-ui/build/assets/*.map | ||
| !webview-ui/build/assets/*.ttf | ||
| !webview-ui/build/assets/*.css | ||
| !webview-ui/build/assets/chunk-*.js |
There was a problem hiding this comment.
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.
| 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()) | ||
|
|
There was a problem hiding this comment.
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:
| // 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.`) | |
| } | |
| } |
|
Issue is not properly scoped |
Summary
This PR fixes the critical failures reported in #6662 where the Roo-Code extension fails to initialize on macOS due to:
Changes
1. Fixed spawn npx ENOENT error
src/services/mcp/McpHub.tsto properly handle npm-related commands (npx, npm, pnpm, yarn) on Windows2. Fixed missing webview assets
src/.vscodeignoreto include:chunk-*.js) generated by the build process*.map) for debugging3. PostHog telemetry errors
src/extension.tsalready handles these errors gracefullyTesting
Related Issues
Fixes #6662
Important
Fixes critical macOS failures by handling npm-related commands on Windows and ensuring webview assets are included.
spawn npx ENOENTerror inMcpHubby wrapping npm-related commands withcmd.exeon Windows..vscodeignoreto includechunk-*.jsand*.mapfiles.This description was created by
for 707295d. You can customize this summary. It will automatically update as commits are pushed.