{"record":{"id":"b133e7bd06943a8c","repo":"microsoft/playwright","slug":"webkit-wsl-is-only-supported-on-windows","errorCode":null,"errorMessage":"webkit-wsl is only supported on Windows","messagePattern":"webkit-wsl is only supported on Windows","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/registry/index.ts","lineNumber":738,"sourceCode":"      installType: webkit.installByDefault ? 'download-by-default' : 'download-on-demand',\n      _validateHostRequirements: (sdkLanguage: string) => this._validateHostRequirements(sdkLanguage, webkit.dir, webkitLinuxLddDirectories, ['libGLESv2.so.2', 'libx264.so'], ['']),\n      downloadURLs: this._downloadURLs(webkit),\n      title: webkit.title,\n      revision: webkit.revision,\n      browserVersion: webkit.browserVersion,\n      _install: force => this._downloadExecutable(webkit, force, webkitExecutable),\n      _dependencyGroup: 'webkit',\n      _isHermeticInstallation: true,\n    });\n    const wslExecutable = process.platform === 'win32' ? path.join(process.env.SystemRoot || 'C:\\\\Windows', 'System32', 'wsl.exe') : undefined;\n    this._executables.push({\n      name: 'webkit-wsl',\n      browserName: 'webkit',\n      directory: webkit.dir,\n      executablePath: () => wslExecutable,\n      executablePathOrDie: () => {\n        if (!wslExecutable)\n          throw new Error(`webkit-wsl is only supported on Windows`);\n        return wslExecutable;\n      },\n      // WebKit is installed inside the WSL distribution by install_webkit_wsl.ps1.\n      wslExecutablePath: `/home/pwuser/.cache/ms-playwright/webkit-${webkit.revision}/pw_run.sh`,\n      installType: 'download-on-demand',\n      title: 'Webkit in WSL',\n      _validateHostRequirements: (sdkLanguage: string) => Promise.resolve(),\n      _isHermeticInstallation: true,\n      _install: async () => {\n        if (process.platform !== 'win32')\n          throw new Error(`WebKit via WSL is only supported on Windows`);\n        const script = path.join(BIN_PATH, 'install_webkit_wsl.ps1');\n        const { code } = await spawnAsync('powershell.exe', [\n          '-ExecutionPolicy', 'Bypass',\n          '-File', script,\n        ], {\n          stdio: 'inherit',\n        });","sourceCodeStart":720,"sourceCodeEnd":756,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/registry/index.ts#L720-L756","documentation":"Thrown by the webkit-wsl executable's executablePathOrDie when wslExecutable is undefined, which happens whenever process.platform is not win32. The webkit-via-WSL build only has a launcher path (System32\\wsl.exe) on Windows, so requesting its executable on macOS/Linux is unsupported.","triggerScenarios":"Enumerating or launching the webkit-wsl executable on a non-Windows host; a config that selects webkit-wsl unconditionally regardless of OS; tooling that iterates all registered executables including webkit-wsl on macOS/Linux.","commonSituations":"Cross-platform test matrices that include webkit-wsl by name; scripts copied from a Windows setup to a macOS/Linux developer machine; CI runners on macOS selecting the wrong webkit variant.","solutions":["On macOS/Linux, use the regular webkit build (npx playwright install webkit) instead of webkit-wsl.","Gate webkit-wsl usage behind a process.platform === 'win32' check in your config.","Exclude webkit-wsl from cross-platform executable enumeration."],"exampleFix":"// before\nconst exe = registry.findExecutable('webkit-wsl')!.executablePathOrDie(); // throws off-Windows\n// after\nconst name = process.platform === 'win32' ? 'webkit-wsl' : 'webkit';\nconst exe = registry.findExecutable(name)!.executablePathOrDie();","handlingStrategy":"type-guard","validationCode":"if (name === 'webkit-wsl' && process.platform !== 'win32')\n  throw new Error('webkit-wsl is Windows-only; use webkit on this platform');","typeGuard":"function isWindowsOnlyExecutable(name: string): boolean {\n  return name === 'webkit-wsl';\n}","tryCatchPattern":null,"preventionTips":["Gate webkit-wsl behind a process.platform === 'win32' check.","Use regular webkit on macOS/Linux.","Filter platform-specific executables in cross-platform tooling."],"tags":["registry","webkit","wsl","platform","windows-only"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}