-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Wrong stacktrace and broken debugging with esbuild.sourcemap:'both'
#2427
Comments
@sheremet-va Thank you for the prompt fix! It fixed the stacktrace indeed, but broke Vitest debugging in IntelliJ/WebStorm. It looks like a problem in IntelliJ/WebStorm, because the tests can still be debugged in VSCode. Unfortunarely, it's hard to release a hotfix of IntelliJ/WebStorm (moreover, it's would require Vitest users with IntelliJ/WebStorm to upgrade their IDEs which would be inconvenient for users). Sorry, may I ask you to restore the previous behavior? Ideally, it would be great to fix this issue and keep IntelliJ/WebStorm debugger working, but I guess it's might be not easy. |
I think if people experience issues, they can always revert Vitest version themselves. Currently the behaviour seems to be fixed on our side, so I don't really see any reason to revert the bug fix, since it was indeed a bug. The stack trace now always has correct source (can you confirm it? is it correct for you, but the issue is somewhere else?). I have a thought on why the issue might happen. With the latest release source map is stored inside |
@sheremet-va This is great! Happy to confirm that #2443 solves the problem. |
Describe the bug
Adding
to vite.config.js breaks failed assertions stacktraces and makes it difficult to debug.
According to https://esbuild.github.io/api/#sourcemap, it should make easier to debug code. But actually, it breaks debugging Vitest tests.
Originally reported here. It might be not a Vitest issue, in this case I'd be grateful if you could re-route the issue.
Interestingly, everything works correctly without
esbuild.sourcemap:'both'
.Would be great if configuring esbuild sourcemap wouldn't worsen experience of Vitest test development.
Reproduction
vitest test/basic.test.ts
=> the failed assertion stacktrace wrongly points to 'test/basic.test.ts:14:40' whereas the assertion is actually failed on 'test/basic.test.ts:19'System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: