flow / flow-for-vscode

Flow for Visual Studio Code
Other
996 stars 111 forks source link

Notification of breaking api change with v1.92 release of VS Code #458

Open deepak1556 opened 2 months ago

deepak1556 commented 2 months ago

Hello from the VS Code team 👋

In our next release v1.92, we will update to Electron 30 which includes Node.js 20.14.0. This Node version contains a breaking change, in response to a CVE, which may affect you if you execute .bat or .cmd files on Windows. Based on a simple scan of your extension's source code, you may be impacted by this change. The stable VS Code that contains this update will be released in early August.

Action: please try out your extension on this month's VS Code Insiders on Windows. If you are affected by this change, you will encounter an EINVAL error when you try to spawn a bat/cmd file.

Node.js has added a section on batch file spawning to their documentation. To fix any issues:

  1. Find locations where you call child_process.spawn to execute a batch file on Windows
  2. Add shell: true or shell: process.platform === 'win32' to the options object
  3. If the batch script path may contain spaces, you will also need to wrap the path in quotation marks.

Please let us know if you run into issues or if you need clarification.

Happy coding!

neutraali commented 3 days ago

This is currently breaking the flow-for-vscode for Windows users. On startup there's a popup that states that "Flow server stopped", and the output panel shows something like this:

[Error - 00:00:00 PM] Starting client failed
Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:800:9)
    at path\to\vscode\extensions\flowtype.flow-for-vscode-2.2.1\build\index.js:1:156960