-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: use correct source maps in stacktrace #2027
Conversation
use vitenode server to get a fetch result instead of a transform result. And then get the sourcemap from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for this, please?
Sure, is there a test example for errors/stacktraces I can check? @sheremet-va |
To be honest, I don't know. |
I found some failure tests I will start from https://github.com/vitest-dev/vitest/blob/main/test/fails/test/runner.test.ts#L0-L1 Then I'll create a couple of tests:
|
The test fails because of this error https://github.com/vitest-dev/vitest/runs/8301687675?check_suite_focus=true#step:7:668
I used my complete plugin to generate the snapshot, but I created a small version of the plugin just for the test. But I don't understand why Vite is complaining about this error. I'd use some help here 🆘 |
Try adding |
Thanks @sheremet-va I was including extra quotes because I copied the value from the debugger. Fixed now :) |
@sheremet-va The tests are failing because of another error in https://github.com/vitest-dev/vitest/blob/main/test/fails/fixtures/timeout.test.ts#L4 that's not related to my PR
Tests were green before I merged main https://github.com/vitest-dev/vitest/runs/8302216560?check_suite_focus=true Seems like there is some flakiness going on with these tests |
@sheremet-va now one test which is not related to my changes seems flaky: https://github.com/vitest-dev/vitest/blob/main/test/fails/test/runner.test.ts
This is related to #2046 and I fixed it by renaming the file |
@sheremet-va can you take a look again? I fixed the previous failing test. But I'm not sure why single threaded tests are failing in Ubuntu? |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@vitest/coverage-c8](https://togithub.com/vitest-dev/vitest) | [`0.23.4` -> `0.24.0`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-c8/0.23.4/0.24.0) | [![age](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/compatibility-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@vitest%2fcoverage-c8/0.24.0/confidence-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest</summary> ### [`v0.24.0`](https://togithub.com/vitest-dev/vitest/releases/tag/v0.24.0) [Compare Source](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0) ##### 🚨 Breaking Changes - Use type module (revert [#​1411](https://togithub.com/vitest-dev/vitest/issues/1411)) - by [@​bluwy](https://togithub.com/bluwy) and [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/1465](https://togithub.com/vitest-dev/vitest/issues/1465) - Drop support for Vite 2 - by [@​antfu](https://togithub.com/antfu) and [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/1928](https://togithub.com/vitest-dev/vitest/issues/1928) ##### 🚀 Features - **benchmark**: Todo mode - by [@​Aslemammad](https://togithub.com/Aslemammad) in [https://github.com/vitest-dev/vitest/issues/2057](https://togithub.com/vitest-dev/vitest/issues/2057) - **inline-snapshot**: Support comment - by [@​azaleta](https://togithub.com/azaleta) in [https://github.com/vitest-dev/vitest/issues/2077](https://togithub.com/vitest-dev/vitest/issues/2077) ##### 🐞 Bug Fixes - Run related test, even if test doesn't have dependencies - by [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/2043](https://togithub.com/vitest-dev/vitest/issues/2043) - Check for asymmetricMatch before accessing - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(75719)</samp>](https://togithub.com/vitest-dev/vitest/commit/757199a6) - Check hook teardown return type, closes [#​2092](https://togithub.com/vitest-dev/vitest/issues/2092) - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(cba3f)</samp>](https://togithub.com/vitest-dev/vitest/commit/cba3ff09) - Don't stop watch mode, if non-object error is thrown, close [#​2106](https://togithub.com/vitest-dev/vitest/issues/2106) - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(bd677)</samp>](https://togithub.com/vitest-dev/vitest/commit/bd677017) - Use correct source maps in stacktrace - by [@​haikyuu](https://togithub.com/haikyuu) in [https://github.com/vitest-dev/vitest/issues/2027](https://togithub.com/vitest-dev/vitest/issues/2027) - Import CustomEventMap from vite for vite-node - by [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/2124](https://togithub.com/vitest-dev/vitest/issues/2124) - **jsdom**: Use jsdom Blob instead of Node, if jsdom is enabled - by [@​ChpShy](https://togithub.com/ChpShy) in [https://github.com/vitest-dev/vitest/issues/2086](https://togithub.com/vitest-dev/vitest/issues/2086) ##### [View changes on GitHub](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/AlexKMarshall/necromunda-turbo). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMjIuMyIsInVwZGF0ZWRJblZlciI6IjMyLjIyMi4zIn0=-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [vitest](https://togithub.com/vitest-dev/vitest) | [`0.23.4` -> `0.24.0`](https://renovatebot.com/diffs/npm/vitest/0.23.4/0.24.0) | [![age](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/compatibility-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/vitest/0.24.0/confidence-slim/0.23.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>vitest-dev/vitest</summary> ### [`v0.24.0`](https://togithub.com/vitest-dev/vitest/releases/tag/v0.24.0) [Compare Source](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0) ##### 🚨 Breaking Changes - Use type module (revert [#​1411](https://togithub.com/vitest-dev/vitest/issues/1411)) - by [@​bluwy](https://togithub.com/bluwy) and [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/1465](https://togithub.com/vitest-dev/vitest/issues/1465) - Drop support for Vite 2 - by [@​antfu](https://togithub.com/antfu) and [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/1928](https://togithub.com/vitest-dev/vitest/issues/1928) ##### 🚀 Features - **benchmark**: Todo mode - by [@​Aslemammad](https://togithub.com/Aslemammad) in [https://github.com/vitest-dev/vitest/issues/2057](https://togithub.com/vitest-dev/vitest/issues/2057) - **inline-snapshot**: Support comment - by [@​azaleta](https://togithub.com/azaleta) in [https://github.com/vitest-dev/vitest/issues/2077](https://togithub.com/vitest-dev/vitest/issues/2077) ##### 🐞 Bug Fixes - Run related test, even if test doesn't have dependencies - by [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/2043](https://togithub.com/vitest-dev/vitest/issues/2043) - Check for asymmetricMatch before accessing - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(75719)</samp>](https://togithub.com/vitest-dev/vitest/commit/757199a6) - Check hook teardown return type, closes [#​2092](https://togithub.com/vitest-dev/vitest/issues/2092) - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(cba3f)</samp>](https://togithub.com/vitest-dev/vitest/commit/cba3ff09) - Don't stop watch mode, if non-object error is thrown, close [#​2106](https://togithub.com/vitest-dev/vitest/issues/2106) - by [@​sheremet-va](https://togithub.com/sheremet-va) [<samp>(bd677)</samp>](https://togithub.com/vitest-dev/vitest/commit/bd677017) - Use correct source maps in stacktrace - by [@​haikyuu](https://togithub.com/haikyuu) in [https://github.com/vitest-dev/vitest/issues/2027](https://togithub.com/vitest-dev/vitest/issues/2027) - Import CustomEventMap from vite for vite-node - by [@​sheremet-va](https://togithub.com/sheremet-va) in [https://github.com/vitest-dev/vitest/issues/2124](https://togithub.com/vitest-dev/vitest/issues/2124) - **jsdom**: Use jsdom Blob instead of Node, if jsdom is enabled - by [@​ChpShy](https://togithub.com/ChpShy) in [https://github.com/vitest-dev/vitest/issues/2086](https://togithub.com/vitest-dev/vitest/issues/2086) ##### [View changes on GitHub](https://togithub.com/vitest-dev/vitest/compare/v0.23.4...v0.24.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/AlexKMarshall/necromunda-turbo). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMjIuMyIsInVwZGF0ZWRJblZlciI6IjMyLjIyMi4zIn0=-->
use vitenode server to get a fetch result instead of a transform result.
And then get the sourcemap from it.
This fixes #2024