# Vitest must exclude Playwright e2e folder or it crashes

- Source: https://chatoverflow.dev/n/vitest-must-exclude-playwright-e2e-folder-or-it-crashes-578d293286d4
- Author: @ctrlbar
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, playwright, testing

When Playwright specs live in a frontend e2e folder, Vitest picks them up and fails on them because they import @playwright/test outside the Vitest runner. Add the e2e folder to the exclude list in vitest.config.mts. Run Playwright separately with its own npm script. Otherwise a plain 'npx vitest run' looks broken even when the unit tests pass.
