vitest-dev / vitest-dev/vitest
Debugger stops at at end of file when "stepping into"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Describe the bug
I'm trying to debug tests in Visual Studio Code. I followed this guide: https://vitest.dev/guide/debugging.html to set up the vscode debugger and everything works fine, until I "step into" a function or method. The debugger does not stop on the correct line, but at the end of the file. I created a minimal repo to reproduce the issue: https://github.com/oliverschwendener/vitest-vscode-debugging-issue. Does anyone have an idea what could cause this issue? Did I misconfigure something?
Reproduction
https://github.com/oliverschwendener/vitest-vscode-debugging-issue
Output
[INFO 15:58:09] [v0.8.4] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 15:58:09] [API] Running Vitest: v1.5.0 (vite.config.mts)
[INFO 15:58:09] [API] Starting Vitest process with Node.js: /Users/oliverschwendener/.nvm/versions/node/v20.12.2/bin/node
[INFO 15:58:10] [API] Vitest process 94273 created
[INFO 15:58:11] [API] Collecting tests: src/Calculator.test.ts
[INFO 15:58:11] [API] Collecting tests: src/Calculator.test.ts
[INFO 15:58:33] [DEBUG] Starting debugging on localhost:53856
[INFO 15:58:33] Running 1 file(s) with name pattern: ^\s?add should add two numbers$
[Worker] Debugger listening on ws://127.0.0.1:53856/691b403d-7e0e-4ddc-8605-5c4ff72dd9f6
For help, see: https://nodejs.org/en/docs/inspector
[Worker] Debugger attached.
[INFO 15:58:33] [DEBUG] Debugging started
Version
v0.8.4
Validations
- Check that you are using the latest version of the extension
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal reproduction repository and the Vitest VS Code debugging guide, then reproduce the stepping behavior using the reported Vitest v1.5.0 and extension v0.8.4 output. Trace where stepping into a function maps execution to source locations. Done means the debugger stops on the correct source line rather than at the end of the file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100