Storybook test-runner "browserType.launch: Executable doesn't exist" in CI
The Storybook test-runner drives a headless browser via Playwright. Installing the npm package does not download the browser binaries, so on a clean runner Playwright fails to launch until you run npx playwright install.
What this error means
The runner fails at launch with "browserType.launch: Executable doesn't exist at ...chromium.../chrome" and a hint to run npx playwright install.
browserType.launch: Executable doesn't exist at
/home/runner/.cache/ms-playwright/chromium-1140/chrome-linux/chrome
Looks like Playwright was just installed or updated.
Please run the following command to download new browsers:
npx playwright installCommon causes
Playwright browsers were never downloaded
The test-runner depends on Playwright, but the workflow installed only npm packages, not the browser binaries.
A version bump invalidated the cached browsers
Upgrading Playwright expects a new browser build that the old cache does not contain.
How to fix it
Install the Playwright browsers before testing
- Add a step that installs the Chromium browser (and OS deps on Linux).
- Run it after
npm ciand beforetest-storybook. - Re-run the job.
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm run test-storybookCache the browser binaries
Persist the Playwright cache so browsers are not re-downloaded every run, keyed on the Playwright version.
- uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('package-lock.json') }}How to prevent it
- Run
npx playwright install --with-depsbefore the test-runner in CI. - Cache
~/.cache/ms-playwrightkeyed on the Playwright version. - Re-run install after upgrading Playwright or the test-runner.