volta-cli / volta

Volta: JS Toolchains as Code. ⚡
https://volta.sh
Other
10.32k stars 220 forks source link

When using child_process.fork() with the execPath pointing to volta on windows ipc breaks. #1756

Open Esurnir opened 1 month ago

Esurnir commented 1 month ago

Linked Issue : vitest-dev/vscode#382

Windows version : 10 22H2 Reproduction repo : https://github.com/Esurnir/volta-vite-repro

Reproduction steps :

  1. Clone the repo,
  2. uncomment the line 11 of index.js
  3. open cmd
  4. run in cmd "C:\Program Files\Volta\node.EXE" index.js Expected output :
    
    D:\Git\Labo\voltaprocess>"C:\Program Files\Volta\node.EXE" index.js
    stdout: Dad is here

PARENT got message: Hello dad ! stdout: path: D:\Git\Labo\voltaprocess

stdout: CHILD got message: parent -> child

^C^C

process does not close by itself.

actual output :

D:\Git\Labo\voltaprocess>"C:\Program Files\Volta\node.EXE" index.js stdout: Dad is here

stdout: path: D:\Git\Labo\voltaprocess

Child exited output Dad is here path: D:\Git\Labo\voltaprocess

D:\Git\Labo\voltaprocess>


process closed.

This cause the issue of the vscode vitest plugin not working.
Esurnir commented 1 month ago

I just realized I switched the output. The first output is the passing output. The second one is the failing. I'll edit it when I get home. Edit : nevermind I just read it too quickly, expected -> actual