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

Suggested .vscode/launch.json requires installing vite #3112

Closed
4 tasks done
JoshuaKGoldberg opened this issue Mar 31, 2023 · 1 comment · Fixed by #3274
Closed
4 tasks done

Suggested .vscode/launch.json requires installing vite #3112

JoshuaKGoldberg opened this issue Mar 31, 2023 · 1 comment · Fixed by #3274

Comments

@JoshuaKGoldberg
Copy link
Contributor

Clear and concise description of the problem

Going through the VS Code debugging guide in https://vitest.dev/guide/debugging.html#vscode, when I run F5 on a repo that doesn't have vite listed as a dependency:

joshgoldberg ~/repos/template-typescript-node-package $  cd /Users/josh/repos/template-typescript-node-package ; /usr/bin/env 'NODE_OPTIONS=--require "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bootloader
.bundle.js"     --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS={"inspectorIpc":"/var/folders/sr/j__6_9gn0dv557z0xf3p7y8h0000gn/T/node-cdp.67533-14.sock","deferredMode":false,"waitForDebugger":"","execPath":"/Users/josh/.nvm/versions/node/v18.7.0/bi
n/node","onlyEntrypoint":false,"autoAttachMode":"always","fileCallback":"/var/folders/sr/j__6_9gn0dv557z0xf3p7y8h0000gn/T/node-debug-callback-00402a5d1b51117e"}' /Users/josh/.nvm/versions/node/v18.7.0/bin/node ./node_modules/vitest/vitest.mjs run src/gree
t.test.ts 
Debugger attached.
 MISSING DEP  Can not find dependency 'vite'

? Do you want to install vite? › (y/N)

Screenshot of the first few dozen columns of the previous console log

After accepting with y (or running pnpm install vite manually), the debug command works.

Reproduction:

Suggested solution

I don't know why this is happening enough to suggest a solution 😞 sorry. ./vitest.mjs is the bin entry in node_modules/vitest/package.json.

Alternative

No response

Additional context

Note that pnpm test in that repository works without adding vitest as a dependency.

Validations

@sheremet-va
Copy link
Member

We use isPackageExists from local-pkg library. I guess it doesn't recognize that vite is installed with Vitest 🤔

ghiscoding added a commit to lerna-lite/lerna-lite that referenced this issue Apr 20, 2023
Vite is somehow required by Vitest when using VSCode debugger in a pnpm workspace, there's an open issue for it: vitest-dev/vitest#3112
@JoshuaKGoldberg JoshuaKGoldberg changed the title Docs: Suggested .vscode/launch.json requires installing vite Suggested .vscode/launch.json requires installing vite Apr 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants