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

Unable to debug vitest tests / source map not recognized #3175

Closed
6 tasks done
dreamorosi opened this issue Apr 11, 2023 · 3 comments · Fixed by #3177
Closed
6 tasks done

Unable to debug vitest tests / source map not recognized #3175

dreamorosi opened this issue Apr 11, 2023 · 3 comments · Fixed by #3177
Assignees

Comments

@dreamorosi
Copy link

Describe the bug

When vitest@^0.30.0 in a TypeScript codebase, I'd like to set breakpoints while debugging.
The debugger doesn't recognize the breakpoints and either skips them or puts them in different lines, as well as returning earlier than expected, suggesting that the debugger is not using the correct source/source map.

See video (repro steps & minimal example below):

repro.mp4

Reproduction

  1. Clone the repo: https://github.com/dreamorosi/vitest-vscode-issue/tree/main (this is a barebones setup with typescript, vitest, and one test+one file)
  2. Go to src/mycode.ts
  3. Place one breakpoint at each line where the comments say it (L7 & L9)
  4. Start a debugging session using the Test pane provided by the Vitest VSCode extension
  5. See that the debugger doesn't work and jumps to different lines (see video below)

Alternatively, instead of step 3, start a debugging session using the recommended launch settings in the vitest docs and observe the same behavior.

System Info

System:
    OS: macOS 12.6.4
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 77.05 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/Library/Caches/fnm_multishells/71008_1681201429706/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 9.6.4 - ~/Library/Caches/fnm_multishells/71008_1681201429706/bin/npm
  Browsers:
    Chrome: 112.0.5615.49
    Safari: 16.4
  npmPackages:
    vitest: ^0.30.0 => 0.30.0

Used Package Manager

npm

Validations

@dreamorosi
Copy link
Author

dreamorosi commented Apr 11, 2023

Hi @sheremet-va, I see that you have closed the issue as completed with a PR.

Any chance you could share when it will be published to npm? Nevermind, I see that you've already published a new release.

@sheremet-va
Copy link
Member

Hi @sheremet-va, I see that you have closed the issue as completed with a PR.

Any chance you could share when it will be published to npm?

7 minutes ago

@dreamorosi
Copy link
Author

I saw, thank you, I edited the comment right after.

Also I confirm that the issue is fixed, thank you for the quick turnaround.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 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