Skip to content
Latchkey

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.

Vitest
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 install

Common 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

  1. Add a step that runs npx playwright install --with-deps chromium.
  2. Then run the Vitest browser-mode suite.
  3. Cache the browser download to speed up later runs.
.github/workflows/ci.yml
- run: npx playwright install --with-deps chromium
- run: vitest run --browser.enabled

Configure the browser provider

Set the Playwright provider and browser so the mode is explicit and matches what you installed.

vitest.config.ts
export default defineConfig({
  test: { browser: { enabled: true, provider: 'playwright', name: 'chromium' } },
})

How to prevent it

  • Run playwright install --with-deps before browser-mode tests.
  • Cache the Playwright browser download between runs.
  • Keep the configured browser name matching the installed one.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →