Summary
bun add -d @vitest/coverage-v8 installs the latest version (v4.x) regardless of which vitest version you’re using (v3.x). The mismatch produces a cryptic error: SyntaxError: The requested module 'vitest/node' does not provide an export named 'BaseCoverageProvider'. The fix: always pin the coverage package to match your vitest major version.
The Error
The Fix
Why This Happens
Bun (and npm) resolve@vitest/coverage-v8 independently from vitest. Since coverage-v8 v4.x published first, bun add grabs it. The internal API (BaseCoverageProvider) changed between v3 and v4, causing the import failure.