{"record":{"id":"7c49a6f21bc9d8fc","repo":"can1357/oh-my-pi","slug":"unsupported-browser-executable-options-browser","errorCode":null,"errorMessage":"Unsupported browser executable: ${options.browser}","messagePattern":"Unsupported browser executable: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/utils/src/browsers.ts","lineNumber":168,"sourceCode":"\n/** Return the Chrome-for-Testing archive URL for a browser build. */\nexport function getDownloadUrl(\n\tbrowser: Browser,\n\tplatform: BrowserPlatform,\n\tbuildId: string,\n\tbaseUrl = CHROME_FOR_TESTING_BASE_URL,\n): URL {\n\tif (browser !== Browser.CHROME) throw new Error(`Unsupported browser download: ${browser}`);\n\tconst archivePlatform = chromeArchivePlatform(platform);\n\tconst root = baseUrl.replace(/\\/$/, \"\");\n\treturn new URL(`${root}/${buildId}/${archivePlatform}/chrome-${archivePlatform}.zip`);\n}\n\n/** Compute the executable path in Puppeteer's cache layout. */\nexport function computeExecutablePath(options: ComputeExecutablePathOptions): string {\n\tconst platform = options.platform ?? detectBrowserPlatform();\n\tif (!platform) throw new Error(\"Cannot determine a browser platform for this host\");\n\tif (options.browser !== Browser.CHROME) throw new Error(`Unsupported browser executable: ${options.browser}`);\n\tconst installDir = installationDir(options.cacheDir, options.browser, platform, options.buildId);\n\tswitch (platform) {\n\t\tcase BrowserPlatform.LINUX:\n\t\tcase BrowserPlatform.LINUX_ARM:\n\t\t\treturn path.join(installDir, \"chrome-linux64\", \"chrome\");\n\t\tcase BrowserPlatform.MAC:\n\t\t\treturn path.join(\n\t\t\t\tinstallDir,\n\t\t\t\t\"chrome-mac-x64\",\n\t\t\t\t\"Google Chrome for Testing.app\",\n\t\t\t\t\"Contents\",\n\t\t\t\t\"MacOS\",\n\t\t\t\t\"Google Chrome for Testing\",\n\t\t\t);\n\t\tcase BrowserPlatform.MAC_ARM:\n\t\t\treturn path.join(\n\t\t\t\tinstallDir,\n\t\t\t\t\"chrome-mac-arm64\",","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/browsers.ts#L150-L186","documentation":"After resolving the platform, computeExecutablePath verifies the requested product is Chrome; any other Browser value throws this Error because the executable layout (chrome-linux64/chrome, chrome-mac-arm64/..., chrome-win64/chrome.exe) is Chrome-specific. It is a capability guard mirroring getDownloadUrl's restriction.","triggerScenarios":"Calling computeExecutablePath({ browser: Browser.CHROMIUM | FIREFOX | CHROMEHEADLESSSHELL | CHROMEDRIVER, buildId, cacheDir }) — directly or via executablePath()/getInstalledBrowsers() with a non-Chrome browser value.","commonSituations":"Listing multiple browsers in config (chrome + chromedriver) and iterating executablePath over all of them; assuming headless-shell shares Chrome's install layout.","solutions":["Only pass Browser.CHROME to computeExecutablePath / executablePath.","Resolve other products' executables with @puppeteer/browsers or product-specific path logic.","Filter your browser collection to CHROME before computing paths."],"exampleFix":"// before\nfor (const b of [Browser.CHROME, Browser.CHROMEDRIVER]) executablePath({ browser: b, buildId });\n// after\nfor (const b of [Browser.CHROME, Browser.CHROMEDRIVER]) {\n  if (b === Browser.CHROME) executablePath({ browser: b, buildId });\n}","handlingStrategy":"type-guard","validationCode":"import { Browser } from './browsers';\nif (options.browser !== Browser.CHROME) {\n  throw new Error(`executablePath supports only chrome; got ${options.browser}`);\n}","typeGuard":"function isChrome(browser: Browser): browser is Browser.CHROME {\n  return browser === Browser.CHROME;\n}","tryCatchPattern":"try {\n  return executablePath({ browser, buildId, cacheDir });\n} catch (err) {\n  if (/^Unsupported browser executable: /.test(String(err))) {\n    // fall back to @puppeteer/browsers' computeExecutablePath for other products\n  } else throw err;\n}","preventionTips":["Filter browser collections to Browser.CHROME before path resolution.","Route other products to @puppeteer/browsers.","Type your install config as Browser.CHROME when only chrome is supported."],"tags":["unsupported-browser","browser-download","executable-path"],"backgroundTag":"unsupported-browser-product","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}