{"record":{"id":"de6d65288be5b50d","repo":"microsoft/playwright","slug":"cannot-find-firefox-installation-for-channel-na","errorCode":null,"errorMessage":"Cannot find Firefox installation for channel '${name}' at the standard system paths. Tried paths:\n  ${prefixes.map(p => path.join(p, suffix)).join('\\n  ')}","messagePattern":"Cannot find Firefox installation for channel '(.+?)' at the standard system paths\\. Tried paths:\n  (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/registry/index.ts","lineNumber":879,"sourceCode":"          throw new Error(`Firefox distribution '${name}' is not supported on ${process.platform}`);\n        return undefined;\n      }\n      const prefixes = (process.platform === 'win32' ? [\n        process.env.LOCALAPPDATA,\n        process.env.PROGRAMFILES,\n        process.env['PROGRAMFILES(X86)'],\n        // In some cases there is no PROGRAMFILES/(86) env var set but HOMEDRIVE is set.\n        process.env.HOMEDRIVE + '\\\\Program Files',\n        process.env.HOMEDRIVE + '\\\\Program Files (x86)',\n      ].filter(Boolean) : ['']) as string[];\n\n      for (const prefix of prefixes) {\n        const executablePath = path.join(prefix, suffix);\n        if (canAccessFile(executablePath))\n          return executablePath;\n      }\n      if (shouldThrow)\n        throw new Error(`Cannot find Firefox installation for channel '${name}' at the standard system paths. ${`Tried paths:\\n  ${prefixes.map(p => path.join(p, suffix)).join('\\n  ')}`}`);\n      return undefined;\n    };\n    return {\n      name,\n      browserName: 'firefox',\n      directory: undefined,\n      executablePath: () => executablePath('', false),\n      executablePathOrDie: (sdkLanguage: string) => executablePath(sdkLanguage, true)!,\n      installType: 'none',\n      _validateHostRequirements: () => Promise.resolve(),\n      _isHermeticInstallation: true,\n      _install: install,\n    };\n  }\n\n  executables(): Executable[] {\n    return this._executables;\n  }","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/registry/index.ts#L861-L897","documentation":"Thrown by the bidi-Firefox channel resolver when the current platform IS supported (suffix exists) but none of the probed prefix+suffix paths are accessible — Firefox is not installed at the standard system locations. Unlike the Chromium variant, this message lists every path that was tried. Only thrown when shouldThrow is true.","triggerScenarios":"Calling executablePathOrDie for the bidi-Firefox channel when the OS is in the lookAt map but canAccessFile returns false for every prefix path. Typical when launching Firefox in BiDi mode against a system install that is absent.","commonSituations":"Clean CI runner or container where Firefox was never installed; Firefox installed via snap/flatpak to a path Playwright does not probe; stale PATH but binary moved.","solutions":["Install Firefox at a standard system path (apt-get install firefox / brew install --cask firefox / official installer).","Switch to Playwright's hermetic bundled firefox: 'npx playwright install firefox'.","Inspect the 'Tried paths' list in the message and either place a binary/symlink at the first path or correct the install location."],"exampleFix":"// before — system firefox missing\nconst browser = await firefox.launch();\n\n// after — hermetic install\n// shell: npx playwright install firefox\nconst browser = await firefox.launch();","handlingStrategy":"try-catch","validationCode":"import { registry } from 'playwright-core/lib/server/registry';\n\nconst exec = registry.findExecutable('firefox');\nconst installed = !!exec?.executablePath(); // non-throwing\nif (!installed) console.warn('Run: npx playwright install firefox');","typeGuard":"function isFirefoxInstalled(): boolean {\n  const exec = registry.findExecutable('firefox');\n  return !!exec?.executablePath();\n}","tryCatchPattern":"try {\n  browser = await firefox.launch();\n} catch (e) {\n  if (/Cannot find Firefox installation/.test(e.message))\n    browser = await chromium.launch(); // cross-engine fallback\n  else throw e;\n}","preventionTips":["Install Firefox at a standard system path or use the bundled build.","On Linux, prefer apt/brew installs over snap which may place binaries outside probed paths.","Add a pre-launch probe in test bootstrap to fail fast with an actionable message."],"tags":["firefox","bidi","browser-not-found","executable-path"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}