Open oliverschwendener opened 3 months ago
Thanks for the reproduction.
It looks like this is due to how Vite SSR transforms imports/exports internally. Vite replaces each named export with a getter of magic variable __vite_ssr...
, so probably this getter call is making an weird jump. When I tested it, it goes to add
body after "step into" 3 times, so that coincides with my assumption.
I'm not sure if there's a solution to this, but probably this issue is reproducible on plain Vite SSR, so actions need to be taken there.
Btw, you are using vscode debugger directly with own launch.json
, so technically this is not vscode extension issue, which is what this repo is about (EDIT: now the issue is moved to main vitest repo). But, the same issue can reproduce either way.
This is very likely related to how Vite SSR transform modifies the variables: https://github.com/ariperkkio/vite-ssr-transform-sourcemaps-issue/
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
Version
v0.8.4
Validations