vitest-dev / vitest-dev/vitest
Uncaught exceptions from webworkers started by tests in browser runner not shown properly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Describe the bug
When using the browser runner, if a test starts a webworker, and that webworker throws an uncaught exception, instead of the exception being properly printed with other test output, it gets shown as stderr output of "null" with no easy way to track down the source of it.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-oszejgfz?file=test%2Fbasic.test.ts
System Info
N/A
See stackblitz.
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the StackBlitz reproduction linked in the issue, specifically test/basic.test.ts, and run it with the browser runner. Trace how uncaught webworker exceptions are collected and reported; done means the exception appears with the other test output and useful source information instead of as stderr from "null".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100