-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Vitest fails to import under Vite App #1118
Copy link
Copy link
Closed
Description
Describe the bug
I'd like to use the same syntax for my client side assertions as my build time testing framework. Unfortunately, Vite seems to load Node.js dependent code when you import Vitest. Is Vitest not compatible with browsers?
ERROR: No matching export in "browser-external:fs" for import "existsSync"
I'm using v0.8.4: https://unpkg.com/browse/vitest@0.8.4/package.json
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-6undtu?file=src%2Fmain.ts&initialPath=__vitest__
System Info
StackBlitz
Vite: 2.9.0Used 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels