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

v0.5.0 failing to activate in a monorepo with vitest.workspace.ts and per-package vite.config.ts #292

Open
6 tasks done
chriswheeldon-peakon opened this issue Mar 15, 2024 · 3 comments

Comments

@chriswheeldon-peakon
Copy link

Describe the bug

I was curious to try it out the new pre-release version with https://github.com/chriswheeldon-peakon/vitest-workspace-cwd but the extension fails to load with:

2024-03-15 14:27:52.495 [error] Activating extension vitest.explorer failed due to an error:
2024-03-15 14:27:52.495 [error] Error: Attempted to insert a duplicate test item ID /Users/jbloggs/code/vitest-workspaces
	at Object.replace (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:138:24636)
	at Ge.reset (/Users/jbloggs/.vscode/extensions/vitest.explorer-0.5.0/dist/extension.js:7:1888)
	at Tt.defineTestProfiles (/Users/jbloggs/.vscode/extensions/vitest.explorer-0.5.0/dist/extension.js:7:5932)
	at async Tt.activate (/Users/jbloggs/.vscode/extensions/vitest.explorer-0.5.0/dist/extension.js:7:7329)
        ...

This is a monorepo with multiple vite.config.ts files (one in each package) and a vitest.workspace.ts in the repo root.

Reproduction

https://github.com/chriswheeldon-peakon/vitest-workspace-cwd

System Info

System:
    OS: macOS 14.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 29.92 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /var/folders/sb/jdkc4cv91zvgvvzwhq9lyc6w0000gp/T/fnm_multishells/12774_1710423566735/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.4 - /var/folders/sb/jdkc4cv91zvgvvzwhq9lyc6w0000gp/T/fnm_multishells/12774_1710423566735/bin/npm
  IDEs:
    VSCode: 1.87.2 - /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: 15.3/15E204a - /usr/bin/xcodebuild
  Browsers:
    Chrome: 122.0.6261.129
    Safari: 17.3.1
  npmPackages:
    vitest: ^1.4.0 => 1.4.0

Used Package Manager

npm

Validations

@sheremet-va sheremet-va added p4-important Violate documented behavior or significantly improves performance (priority) needs test and removed pending triage labels Mar 15, 2024
@sheremet-va
Copy link
Member

This should be fixed by 2983175 in 0.5.2

I am marking this as "needs test" to catch the regression in the future, but for now, we are breaking things/moving fast.

@sheremet-va sheremet-va removed the p4-important Violate documented behavior or significantly improves performance (priority) label Mar 15, 2024
@chriswheeldon-peakon
Copy link
Author

@sheremet-va can confirm the extension now loads in that repository! Thanks 🤩

@lestephane
Copy link

Works for me too, is there a way to say "use vitest.explorer@^0.5.2" in devcontainer.json? I can't get that to work, and am forced to pin to a very specific version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants