Skip to content
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

Volta support / Process exited with code 0 #382

Closed
4 tasks done
Esurnir opened this issue May 13, 2024 · 5 comments · Fixed by #384
Closed
4 tasks done

Volta support / Process exited with code 0 #382

Esurnir opened this issue May 13, 2024 · 5 comments · Fixed by #384

Comments

@Esurnir
Copy link
Contributor

Esurnir commented May 13, 2024

Describe the bug

When running visual studio code on a system using volta (With lts installed as the default node version). The visual studio code extension fail to start.

It seems to open the node process with the "C:\Program Files\Volta\node.EXE" --dns-result-order=ipv4first C:/Users/jbzeller/.vscode/extensions/vitest.explorer-0.10.2/dist/worker.js command line. which seems to open then close immediately without error. The command is then relayed to the real node installation.

Reproduction

  1. Use https://github.com/vitest-dev/vitest/tree/main/examples/basic as a basic sample folder.
  2. Install volta on your machine (uninstalling existing node installation first).
  3. volta install node@20
  4. In the folder run npm install
  5. Open visual studio code with the vitest extension installed.

Output

[INFO 16:14:41] [v0.10.2] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 16:14:42] [API] Running Vitest: v1.6.0 (vite.config.ts)
[INFO 16:14:42] [API] Starting Vitest process with Node.js: C:\Program Files\Volta\node.EXE
[Error 16:14:43] [Error Error] Vitest process exited with code 0
Error: Vitest process exited with code 0
	at ChildProcess.d (c:\Users\jbzeller\.vscode\extensions\vitest.explorer-0.10.2\dist\extension.js:21:170)
	at ChildProcess.emit (node:events:517:28)

Version

0.10.2

Validations

@mil7
Copy link

mil7 commented May 16, 2024

This bug report is totally related to this discussion: #378 . With a great addition: A correlation with volta is made.

@Esurnir
Copy link
Contributor Author

Esurnir commented May 16, 2024

I got some news !

This is due to the fact the extension is using the execPath option to point to volta instead of not using the option.

Repro here sorry in advance I was trying different things in that repo to reproduce the issue.

How to reproduce (sorry I put the working test case in the repo, to get the failing case, uncomment execPath):
Without execPath everything works great.

  1. Clone.
  2. Go to the folder.
  3. execute "C:\Program Files\Volta\node.EXE" index.js
    You get ipc working, the process keeps working.
    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

Now uncomment execPath, the process exit and the parent doesn't get any output on the message event, everything broken.
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>

@sheremet-va
Copy link
Member

We need to point to user's Node.js, not VSCode's instance. This doesn't fix the issue, but creates another.

@Esurnir
Copy link
Contributor Author

Esurnir commented May 16, 2024

Created an issue on volta about the issue.

The command "volta which node" output the executable that'll be run in the current folder (if we decide to add a volta workaround and volta just can't relay the ipc messages).

D:\Git\Labo\voltaprocess>volta which node
C:\Users\jbzeller\AppData\Local\Volta\tools\image\node\20.13.1\node.exe

D:\Git\Labo\voltaprocess>

@sheremet-va
Copy link
Member

The command "volta which node" output the executable that'll be run in the current folder (if we decide to add a volta workaround and volta just can't relay the ipc messages).

PR welcome to add support for this, shouldn't be hard to do

@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants