-
-
Notifications
You must be signed in to change notification settings - Fork 85
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 not starting up due to failed version check on windows #88
Comments
I got the same warning on MacOS
|
same warning on MacOS |
I have the same issue on a Mac, here's an example repo https://github.com/philwolstenholme/wolstenhol-11ty/ Extension version |
Same issue on Ubuntu 20.04.5. Extension version v0.2.32 |
I've seen this as well on Windows with Ubuntu 22.04 on WSL. I suspect the root cause could be a bug in vscode-server. At least in my case when I've seen this, shutting down all VSCode instances and restarting has cleared up the problem, but it still re-occurs at random. I'll try to investigate a bit more if I see it again. I suspect when this happens the extension does not even have a Vitest version number. |
Same issue on Ubuntu 22.04 |
Same, doesn't run tests on OS X Ventura. |
Same here: |
Same here I clicked Vitest: Enable assuming that was required... |
I think that I found a fix: the problem seems to come from node not being installed globally, but by a version manager (in my case |
This makes perfect sense, I have nvm for windows, I wonder how many people share the same environment... Just out of curiosity, what are the next steps in a case like this? Do people take it on themselves to try to fix the bug? Have you already done that? Apologies if that's a noob question! |
I can confirm this. I originally installed Node on my MacOS machine via NVM, and I was having this issue. I just went and downloaded the installer from https://nodejs.org/en/download/ and installed Node through the wizard. Restarted VSCode a couple times, and now I'm getting test results in the UI! |
Thanks for the reproduction. The issue is not limited to Windows, I'm having it on macOS as well. As for the next step, I've created a PR (#118), I'm waiting for the maintainers to review it. |
same problem here |
Sorry, but the "fix" in PR #118 actually caused this to start happening again for me. I had to revert to the previous version (v0.2.36) in order to not get the above error. Some details:
At some point in the past, I had set the setting remote.WSL.useShellEnvironment to false. ("If set [true], the WSL windows gets the environment from the shell it was opened from.") For versions of the extension prior to the current (< v0.2.37), when I set remote.WSL.useShellEnvironment back to the default (true), the extension would identify the vitest version correctly, provided that VSCode was started from the Linux command line in the proper environment (as opposed to the Windows desktop where it would still fail). For the current version (v0.2.37), I get |
Hi Jonathan,
(I'm not the maintainer, just a contributor)
I'm sorry that the change broke your setup.
I don't have any windows machine to reproduce the bug.
I don't know if there's a reliable way to determine when we should pass the
process.execPath param or not (maybe there are some env variables that
differ?).
We could maybe do it this way:
- launch vitest without passing the process.execPath
- if it fails, launch it with the process.execPath param.
Lorentz, Braden, Lucas the fix was merged, does it now work on your end?
Best,
Nicolas
…On Fri, Jan 20, 2023 at 9:41 AM Jonathan Kimball ***@***.***> wrote:
Sorry, but the "fix" in PR #118
<#118> actually caused this to
start happening again for me. I had to revert to the previous version
(v0.2.36) in order to not get the above error.
Some details:
- I'm on Windows with Ubuntu 22.04 on WSL.
- All installations of Node are managed via nvm.
At some point in the past, I had set the setting
remote.WSL.useShellEnvironment to *false*. ("If set [true], the WSL
windows gets the environment from the shell it was opened from.")
For versions of the extension prior to the current (< v0.2.37), when I set
remote.WSL.useShellEnvironment back to the default (*true*), the
extension would identify the vitest version correctly, provided that VSCode
was started from the Linux command line in the proper environment (as
opposed to the Windows desktop where it would still fail).
For the current version (v0.2.37), I get Vitest version = undefined and Because
Vitest version < 0.12.0 ... regardless of the
remote.WSL.useShellEnvironment setting. Reverting to the previous extension
version now fixes the problem for me.
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAENRQHQVUTCKKICGZGD3VLWTJFTNANCNFSM6AAAAAAQYTBHZY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I am getting the same error on Windows. |
Hi Aniket,
I'll try to work on a fix.
…On Sun, Jan 22, 2023 at 9:20 AM Aniket Pandharabale < ***@***.***> wrote:
I am getting the same error on Windows.
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAENRQEOQLJS56TORIPFMZLWTTUTBANCNFSM6AAAAAAQYTBHZY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@JAKimball @aniketicloud, could you try #125 to see if it fixes the issue?
A new VSCode window will open, try to open a few projects, and please let me know if the extensions detect the version. |
@ngirardin Works with the project I was having issues :) |
|
@mrcaidev did you tried the steps in #88 (comment) ? |
Error log
|
Did you run `npm install` first?
…On Thu, Jan 26, 2023 at 4:30 AM Yuwang Cai ***@***.***> wrote:
@mrcaidev <https://github.com/mrcaidev> did you tried the steps in #88
(comment)
<#88 (comment)> ?
npm run compile can't resolve birpc and flatted.
Error log
CLI Building entry: ./src/extension.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v5.12.9
CLI Target: node12
CJS Build start
✘ [ERROR] Could not resolve "birpc"
src/pure/watch/ws-client.ts:5:28:
5 │ import { createBirpc } from 'birpc'
╵ ~~~~~~~
You can mark the path "birpc" as external to exclude it from the bundle, which will remove this
error.
✘ [ERROR] Could not resolve "flatted"
src/pure/watch/ws-client.ts:6:33:
6 │ import { parse, stringify } from 'flatted'
╵ ~~~~~~~~~
You can mark the path "flatted" as external to exclude it from the bundle, which will remove this
error.
CJS Build failed
Error: Build failed with 2 errors:
src/pure/watch/ws-client.ts:5:28: ERROR: Could not resolve "birpc"
src/pure/watch/ws-client.ts:6:33: ERROR: Could not resolve "flatted"
...
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAENRQC4VAJMZIEJUQMAHFDWUHVWRANCNFSM6AAAAAAQYTBHZY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Solved. I installed it with pnpm and somehow the dependencies broke, but with npm it works well. And the extension works perfectly in the debug session. ❤️ |
Thanks, I'm glad to be here! I'm waiting for a maintainer to merge the pull
request.
…On Thu, Jan 26, 2023 at 9:34 AM Yuwang Cai ***@***.***> wrote:
Did you run npm install first?
… <#m_3573095887877003356_>
On Thu, Jan 26, 2023 at 4:30 AM Yuwang Cai *@*.*> wrote: @mrcaidev
<https://github.com/mrcaidev> https://github.com/mrcaidev
<https://github.com/mrcaidev> did you tried the steps in #88
<#88> (comment) <#88 (comment)
<#88 (comment)>> ?
npm run compile can't resolve birpc and flatted. Error log CLI Building
entry: ./src/extension.ts CLI Using tsconfig: tsconfig.json CLI tsup
v5.12.9 CLI Target: node12 CJS Build start ✘ [ERROR] Could not resolve
"birpc" src/pure/watch/ws-client.ts:5:28: 5 │ import { createBirpc } from
'birpc' ╵ ~~~~~~~ You can mark the path "birpc" as external to exclude it
from the bundle, which will remove this error. ✘ [ERROR] Could not resolve
"flatted" src/pure/watch/ws-client.ts:6:33: 6 │ import { parse, stringify }
from 'flatted' ╵ ~~~~~~~~~ You can mark the path "flatted" as external to
exclude it from the bundle, which will remove this error. CJS Build failed
Error: Build failed with 2 errors: src/pure/watch/ws-client.ts:5:28: ERROR:
Could not resolve "birpc" src/pure/watch/ws-client.ts:6:33: ERROR: Could
not resolve "flatted" ... — Reply to this email directly, view it on GitHub
<#88 (comment)
<#88 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAENRQC4VAJMZIEJUQMAHFDWUHVWRANCNFSM6AAAAAAQYTBHZY
<https://github.com/notifications/unsubscribe-auth/AAENRQC4VAJMZIEJUQMAHFDWUHVWRANCNFSM6AAAAAAQYTBHZY>
. You are receiving this because you were mentioned.Message ID: @.*>
Solved. I installed it with pnpm and somehow the dependencies broke, but
with npm it works well.
And the extension works perfectly in the debug session. ❤️
—
Reply to this email directly, view it on GitHub
<#88 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAENRQBBQGZ6CWMVQXPZ4HDWUIZJTANCNFSM6AAAAAAQYTBHZY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Not every workspace root in my project is a JS project. But I think I should still be able to use |
Is there a workaround for |
@ngirardin 's PR is merged and released now. Is it still happening? @JAKimball |
Thank you everyone for the feedback 🤗 |
pnpm +1 |
Still an issue. Version: v0.2.39
|
I'm also having this issue. using nvm for windows and pnpm |
Lately I had the same issue with latest extension and Vitest (Windows, fnm & pnpm). As my repository is a monorepo, I had Vitest installed in specific packages. The solution was to hoist Vitest to the root |
Solved with Vitest Workspace: import { defineWorkspace } from "vitest/config";
export default defineWorkspace(["packages/*", "apps/*"]); And nothing else. Plus, I installed Vitest in the monorepo root. |
Not working for me, I am not using a monorepo. Using windows. Error text reads as follows |
I have having the same issue, no monorepo but pnpm |
Seem like newest version bring back this issue - or at least on my Windows. |
Having this same issue, tried the steps above and I was not able to figure it out. I'll downgrade for now. |
related with #116 ? |
I fixed this issue on Windows by moving my code from a path with spaces to one without. When the extension calls
Extension Version: 0.2.42 |
I am using
|
@keith-harrison-iopt Thank you my dear sir! |
If anyone stumbled upon this, I've debugged it for a really long time and at the end the issue was that the If it somehow doesn't work in your workspace, try running this command to see if the server is even able to spin up properly:
If this fails, resolve those issues and reload the window when it runs without crashing |
Describe the bug
Hi there,
Every time I start up vscode it keeps telling me,
"Because Vitest version < 0.12.0 for every workspace folder, run/debug/watch tests from Vitest extension disabled."
Tried uninstall / install but it won't come up again.
Sth. I should be aware off ?
Thx!
To Reproduce
have vitest 0.23.4 installed, used the cmd: npm init vue@3 to create a totally new package
installed your vitest extension.
Restart vscode, see error appearing.
Expected behavior
possible to start the tests through test explorer or using the green play icon
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
windows 10, vscode :
Version: 1.71.2 (user setup)
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Datum: 2022-09-14T21:03:37.738Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
Betriebssystem: Windows_NT x64 10.0.19044
Sandkasten: No
Additional context
same setup on macos works
The text was updated successfully, but these errors were encountered: