microsoft/playwright · error · Error

WebKit via WSL is only supported on Windows

Error message

WebKit via WSL is only supported on Windows

What it means

Thrown by the webkit-wsl executable's _install routine when process.platform is not win32. The installer runs install_webkit_wsl.ps1 via powershell.exe, which only exists on Windows; attempting to run the WSL-based install elsewhere is rejected up front.

Source

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

    this._executables.push({
      name: 'webkit-wsl',
      browserName: 'webkit',
      directory: webkit.dir,
      executablePath: () => wslExecutable,
      executablePathOrDie: () => {
        if (!wslExecutable)
          throw new Error(`webkit-wsl is only supported on Windows`);
        return wslExecutable;
      },
      // WebKit is installed inside the WSL distribution by install_webkit_wsl.ps1.
      wslExecutablePath: `/home/pwuser/.cache/ms-playwright/webkit-${webkit.revision}/pw_run.sh`,
      installType: 'download-on-demand',
      title: 'Webkit in WSL',
      _validateHostRequirements: (sdkLanguage: string) => Promise.resolve(),
      _isHermeticInstallation: true,
      _install: async () => {
        if (process.platform !== 'win32')
          throw new Error(`WebKit via WSL is only supported on Windows`);
        const script = path.join(BIN_PATH, 'install_webkit_wsl.ps1');
        const { code } = await spawnAsync('powershell.exe', [
          '-ExecutionPolicy', 'Bypass',
          '-File', script,
        ], {
          stdio: 'inherit',
        });
        if (code !== 0)
          throw new Error(`Failed to install WebKit via WSL`);
      },
    });

    const ffmpeg = descriptors.find(d => d.name === 'ffmpeg')!;
    const ffmpegExecutable = findExecutablePath(ffmpeg.dir, 'ffmpeg');
    this._executables.push({
      name: 'ffmpeg',
      browserName: undefined,
      directory: ffmpeg.dir,

View on GitHub (pinned to c8fc3bf8d3)

Solutions

  1. On macOS/Linux, install the regular webkit build instead (`npx playwright install webkit`).
  2. Restrict webkit-wsl installation to Windows runners in your matrix.
  3. Filter platform-specific executables out of any 'install everything' routine.

Example fix

# before (runs on all platforms)
npx playwright install webkit-wsl
# after (Windows only)
# Windows runner:
npx playwright install webkit-wsl
# macOS/Linux runner:
npx playwright install webkit
Defensive patterns

Strategy: validation

Validate before calling

if (executable === 'webkit-wsl' && process.platform !== 'win32')
  throw new Error('skip webkit-wsl install off Windows');

Prevention

When it happens

Trigger: Triggering `playwright install webkit-wsl` (or the on-demand download) on macOS or Linux; an install routine that lists all executables including webkit-wsl and tries to install each.

Common situations: A cross-platform install script that does not filter webkit-wsl; copying a Windows install workflow to a non-Windows CI runner.

Related errors


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