{"record":{"id":"a316c9d9eadd1cfe","repo":"microsoft/playwright","slug":"failed-to-launch-webkit-because-executable-doesn-t","errorCode":null,"errorMessage":"Failed to launch webkit because executable doesn't exist at ${options.executablePath}","messagePattern":"Failed to launch webkit because executable doesn't exist at (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/playwright-core/src/server/webkit/webkit.ts","lineNumber":74,"sourceCode":"  override amendEnvironment(env: NodeJS.ProcessEnv, userDataDir: string, isPersistent: boolean, options: types.LaunchOptions): NodeJS.ProcessEnv {\n    return {\n      ...env,\n      // Cookie jar is only used by the Windows port of WebKit.\n      CURL_COOKIE_JAR_PATH: process.platform === 'win32' && options.channel !== 'webkit-wsl' && isPersistent ? path.join(userDataDir, 'cookiejar.db') : undefined,\n    };\n  }\n\n  override supportsPipeTransport(options: types.LaunchOptions): boolean {\n    return options.channel !== 'webkit-wsl';\n  }\n\n  override async resolveExecutablePath(options: types.LaunchOptions): Promise<string | undefined> {\n    if (options.channel !== 'webkit-wsl')\n      return super.resolveExecutablePath(options);\n    // executablePath points inside the WSL distribution and is consumed in defaultArgs; the\n    // host command is wsl.exe from the registry.\n    if (options.executablePath && !await wslPathExists(options.executablePath))\n      throw new Error(`Failed to launch webkit because executable doesn't exist at ${options.executablePath}`);\n    return undefined;\n  }\n\n  override async waitForReadyState(options: types.LaunchOptions, browserLogsCollector: RecentLogsCollector): Promise<{ wsEndpoint?: string }> {\n    if (options.channel !== 'webkit-wsl')\n      return {};\n    const result = new ManualPromise<{ wsEndpoint?: string }>();\n    browserLogsCollector.onMessage(message => {\n      const match = message.match(/Playwright listening on (ws:\\/\\/\\S+)/);\n      if (match)\n        result.resolve({ wsEndpoint: match[1] });\n    });\n    return result;\n  }\n\n  override doRewriteStartupLog(logs: string): string {\n    if (logs.includes('Failed to open display') || logs.includes('cannot open display'))\n      logs = '\\n' + wrapInASCIIBox(kNoXServerRunningError, 1);","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/webkit/webkit.ts#L56-L92","documentation":"When launching with channel 'webkit-wsl', Playwright runs the WebKit binary inside a WSL distribution and verifies the WSL-side executable path exists via wslPathExists before launching. If options.executablePath was set but the file is not visible inside WSL, launch aborts here rather than producing a confusing wsl.exe error later.","triggerScenarios":"Launching chromium/webkit with channel 'webkit-wsl' and an executablePath that does not exist inside the WSL distribution; the WSL distro not installed; the path using a Windows-style (C:\\...) path instead of a Linux (/home/...) path.","commonSituations":"Switching from a Windows-native build to the webkit-wsl channel without updating the executable path; WSL distro name mismatch; the build artifact not yet copied into the distro.","solutions":["Confirm the executable exists inside WSL: `wsl -d <distro> -- ls -l <path>`.","Provide a Linux-style absolute path (/usr/... or /home/...) for executablePath, not a Windows path.","If you want Playwright's bundled webkit-wsl build, omit executablePath so registry.findExecutable('webkit-wsl') resolves it."],"exampleFix":"// before\nbrowser = await chromium.launch({ channel: 'webkit-wsl', executablePath: 'C:\\\\builds\\\\webkit.exe' });\n\n// after\nbrowser = await chromium.launch({ channel: 'webkit-wsl', executablePath: '/home/user/webkit/bin/playwright-webkit' });\n// or omit executablePath to use the bundled build","handlingStrategy":"validation","validationCode":"const { execSync } = require('child_process');\nfunction assertWslExists(dist, linuxPath) {\n  try {\n    execSync(`wsl.exe -d ${dist} -- test -f ${linuxPath}`, { stdio: 'ignore' });\n  } catch {\n    throw new Error(`WSL executable not found: ${dist}:${linuxPath}`);\n  }\n}\n// call before launch with channel 'webkit-wsl'","typeGuard":null,"tryCatchPattern":"try { browser = await chromium.launch({ channel: 'webkit-wsl', executablePath }); }\ncatch (e) {\n  if (/executable doesn't exist/i.test(String(e.message))) {\n    // fall back to bundled build, or surface a clear setup error\n    browser = await chromium.launch({ channel: 'webkit-wsl' });\n  } else throw e;\n}","preventionTips":["Verify the path inside WSL with `wsl -d <distro> -- ls -l <path>` before launch.","Use Linux-style absolute paths for executablePath, never Windows paths.","Omit executablePath to let Playwright resolve its bundled webkit-wsl build."],"tags":["webkit","wsl","launch","executable","windows"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}