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

Errors thrown inside setTimeout lose their stack trace #1779

Closed
6 tasks done
matt-smarsh opened this issue Aug 3, 2022 · 2 comments
Closed
6 tasks done

Errors thrown inside setTimeout lose their stack trace #1779

matt-smarsh opened this issue Aug 3, 2022 · 2 comments

Comments

@matt-smarsh
Copy link

Describe the bug

Errors thrown in a setTimeout() block do not receive a stack trace when running in Node v16.16.0

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-m7mxed?file=test%2Fbasic.test.ts

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 3.98 GB / 15.75 GB
  Binaries:
    Node: 16.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.14.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.77)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vite: 3.0.4 => 3.0.4
    vitest: 0.20.3 => 0.20.3

Used Package Manager

npm

Validations

@matt-smarsh
Copy link
Author

matt-smarsh commented Aug 3, 2022

Output from Node v16.16.0:
image

It would be desirable to have the stack trace:
image

I migrated a large test suite to remove the callback-style (done) => {} syntax to new Promise((done) => {}) and there's a test failing somewhere but I have no idea where because the error message is also a generic assertion error.

@sheremet-va
Copy link
Member

sheremet-va commented Aug 4, 2022

Fixed in #1777

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

No branches or pull requests

2 participants