vitest-dev / vitest-dev/vitest

Uncaught exceptions from webworkers started by tests in browser runner not shown properly

Open
#7,440 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat: browser p2-nice-to-have
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.