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

vitest version not detected with nvm and pnpm #138

Closed
jonyo opened this issue Mar 2, 2023 · 1 comment
Closed

vitest version not detected with nvm and pnpm #138

jonyo opened this issue Mar 2, 2023 · 1 comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@jonyo
Copy link

jonyo commented Mar 2, 2023

Describe the bug
It gives the error:

[Extension Host] Error: Cannot get vitest version. Please open an issue at https://github.com/vitest-dev/vscode/issues and join the logs above.

To Reproduce
Steps to reproduce the behavior on the example project:

  1. On mac, be using a repo with vitest and playwright set up, and vitest already working on command line.
  2. Be using nvm for node.
  3. Try to install / enable the extension.
  4. See error

Expected behavior
The extension loads and lets you run tests in VSC instead of giving an error.

Environment

(Paste info.txt content generated by the example project)

No info.txt generated. Instead got this error:

╰─± node setup.mjs
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.08s.
Vitest settings updated
/bin/sh: /Applications/Visual: No such file or directory
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v19.6.0

Maybe because of the space in the path?

  • OS: macOS
  • VSCode version: 1.75.1 (Universal)
  • Vitest version: vitest/0.12.10 darwin-x64 node-v19.6.0 (in this test repo
    • vitest/0.28.5 in my own repo I am trying to get the extension working
  • Vitest plugin version: v0.2.39

Additional context

I noticed the setup script set the nodeEnv value in the settings. With it set the tests do work on the example repo (though the setup does not finish as mentioned above). We commit the settings file, and since the PATH is not the same on everyone's machine, setting the value in the project settings isn't really viable.

@jonyo jonyo added the p3-minor-bug An edge case that only affects very specific usage (priority) label Mar 2, 2023
@sheremet-va
Copy link
Member

sheremet-va commented Mar 15, 2024

This should be fixed in pre-release 0.5.0 and higher. Note that the extension now requires Vitest 1.4.0 or higher.

It's possible that this is not fixed, - if you still have the issue, feel free to leave a comment here.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants