microsoft/playwright · error · Error

No chromium-based browser found on the system. Please run th

Error message

No chromium-based browser found on the system.
Please run the following command to download one:

    ${installCommand}

<3 Playwright Team

What it means

Thrown by findChromiumChannelBestEffort (used by launchApp for UI Mode / Trace Viewer) when the loop over ['chromium','chrome','msedge'] finds none of them via executablePathOrDie — no hermetic chromium installed and no system Chrome/Edge detected. The boxed message directs the user to run 'playwright install chromium'.

Source

Thrown at packages/playwright-core/src/server/registry/index.ts:1378

    try {
      registry.findExecutable(name)!.executablePathOrDie(sdkLanguage);
      channel = name === 'chromium' ? undefined : name;
      break;
    } catch (e) {
    }
  }

  if (channel === null) {
    const installCommand = buildPlaywrightCLICommand(sdkLanguage, `install chromium`);
    const prettyMessage = [
      `No chromium-based browser found on the system.`,
      `Please run the following command to download one:`,
      ``,
      `    ${installCommand}`,
      ``,
      `<3 Playwright Team`,
    ].join('\n');
    throw new Error('\n' + wrapInASCIIBox(prettyMessage, 1));
  }
  return channel;
}

function lowercaseAllKeys(json: any): any {
  if (typeof json !== 'object' || !json)
    return json;

  if (Array.isArray(json))
    return json.map(lowercaseAllKeys);

  const result: any = {};
  for (const [key, value] of Object.entries(json))
    result[key.toLowerCase()] = lowercaseAllKeys(value);
  return result;
}

export const registry = new Registry(require(path.join(packageRoot, 'browsers.json')));

View on GitHub (pinned to c8fc3bf8d3)

Solutions

  1. Run the command shown in the message: 'npx playwright install chromium'.
  2. Install Google Chrome or Microsoft Edge system-wide so the best-effort detection succeeds.
  3. Ensure the registry directory and bundled chromium are present (re-run 'npm install' for Playwright).

Example fix

// before — UI Mode launch fails
// shell: npx playwright test --ui

// after — install chromium first
// shell: npx playwright install chromium && npx playwright test --ui
Defensive patterns

Strategy: try-catch

Validate before calling

import { existsSync } from 'fs';
import { join } from 'path';

// Best-effort pre-check before launching UI Mode / Trace Viewer
const browsersPath = process.env.PLAYWRIGHT_BROWSERS_PATH || join(require('os').homedir(), '.cache', 'ms-playwright');
const hasChromium = existsSync(browsersPath) && require('fs').readdirSync(browsersPath).some(d => d.startsWith('chromium'));
if (!hasChromium) console.warn('Run: npx playwright install chromium');

Type guard

function hasAnyChromiumBrowser(): boolean {
  for (const name of ['chromium', 'chrome', 'msedge']) {
    const exec = registry.findExecutable(name);
    if (exec?.executablePath()) return true;
  }
  return false;
}

Try / catch

try {
  const channel = findChromiumChannelBestEffort(sdkLanguage);
} catch (e) {
  if (/No chromium-based browser found/.test(e.message))
    throw new Error('Run `npx playwright install chromium` before starting UI Mode');
  else throw e;
}

Prevention

When it happens

Trigger: Opening UI Mode or the Trace Viewer on a machine where neither bundled chromium nor system chrome/msedge is installed — every executablePathOrDie call threw, leaving channel null.

Common situations: First run of 'npx playwright test --ui' or 'npx playwright show-tracer' before any browser was installed; a container image that skips browser download (PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD) and has no system Chrome.

Related errors


AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12). Data as JSON: /api/errors/cf04136ad9d2a04f. Report an issue: GitHub.