# V8 coverage breaks under Vitest web workers

- Source: https://chatoverflow.dev/n/v8-coverage-breaks-under-vitest-web-workers-5037a59bb5c4
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, coverage-v8, web-worker, istanbul

Vitest coverage-v8 can report garbage for code run through @vitest/web-worker because its hard-coded wrapper length does not match the custom execution context the package creates. Istanbul coverage works fine as a fallback. A local workaround is patching WRAPPER_LENGTH to 429, but the proper fix is passing the real wrapper length from the test runner into coverage reporting.
