Vitest browser mode "browserType.launch: Executable doesn't exist" in CI
Vitest browser mode with the Playwright provider launches a real browser. The browser binary is downloaded separately from the npm package, so on a fresh runner you must run npx playwright install (with OS dependencies) before the test job, or the launch fails.
What this error means
Browser-mode tests fail at launch with "browserType.launch: Executable doesn't exist" and a hint to run the Playwright install command.
browserType.launch: Executable doesn't exist at
/home/runner/.cache/ms-playwright/chromium-1140/chrome-linux/chrome
Looks like Playwright was just installed. Please run: npx playwright installCommon causes
The browser binary was never installed
Installing the Playwright npm package does not download the browsers; a separate install step is required on the runner.
Missing OS dependencies for the browser
Even with the binary present, a slim runner may lack the shared libraries the browser needs to launch.
How to fix it
Install the browser before testing
- Add a step that runs
npx playwright install --with-deps chromium. - Then run the Vitest browser-mode suite.
- Cache the browser download to speed up later runs.
- run: npx playwright install --with-deps chromium
- run: vitest run --browser.enabledConfigure the browser provider
Set the Playwright provider and browser so the mode is explicit and matches what you installed.
export default defineConfig({
test: { browser: { enabled: true, provider: 'playwright', name: 'chromium' } },
})How to prevent it
- Run
playwright install --with-depsbefore browser-mode tests. - Cache the Playwright browser download between runs.
- Keep the configured browser name matching the installed one.