{"record":{"id":"84d6ff464065ff96","repo":"n8n-io/n8n","slug":"browser-not-available-browser","errorCode":null,"errorMessage":"Browser not available: ${browser}","messagePattern":"Browser not available: (.+?)","errorType":"exception","errorClass":"BrowserNotAvailableError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/mcp-browser/src/connection.ts","lineNumber":202,"sourceCode":"\t\treturn this.config;\n\t}\n\n\t// -------------------------------------------------------------------------\n\t// Private\n\t// -------------------------------------------------------------------------\n\n\tgetAvailableBrowsers(): BrowserName[] {\n\t\treturn [...this.config.browsers.entries()]\n\t\t\t.filter(([_, v]) => v.available)\n\t\t\t.map(([name]) => name);\n\t}\n\n\tprivate requireBrowserAvailable(browser: BrowserName): void {\n\t\tconst info = this.config.browsers.get(browser);\n\t\tif (!info?.available) {\n\t\t\tconst available = this.getAvailableBrowsers();\n\t\t\tconst instructions = getInstallInstructions(browser);\n\t\t\tthrow new BrowserNotAvailableError(browser, available, instructions);\n\t\t}\n\t}\n\n\tprivate async createAdapter(): Promise<Adapter> {\n\t\tif (this.config.mode === 'remote') {\n\t\t\t// Remote mode is only supported by the Playwright adapter\n\t\t\tconst { PlaywrightAdapter } = await import('./adapters/playwright.js');\n\t\t\treturn new PlaywrightAdapter(this.config, {\n\t\t\t\trelay: this.externalRelay,\n\t\t\t\tcdpEndpoint: this.externalCdpEndpoint,\n\t\t\t\tcdpConnectHeaders: this.cdpConnectHeaders,\n\t\t\t});\n\t\t}\n\t\tif (this.config.adapter === 'agent-browser') {\n\t\t\tconst { AgentBrowserAdapter } = await import('./adapters/agent-browser.js');\n\t\t\treturn new AgentBrowserAdapter(this.config);\n\t\t}\n\t\tconst { PlaywrightAdapter } = await import('./adapters/playwright.js');","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/mcp-browser/src/connection.ts#L184-L220","documentation":"BrowserNotAvailableError is thrown by requireBrowserAvailable when the requested browser's info is missing or marked unavailable in the config map. The error message names the browser and the hint lists compatible Chromium-based alternatives plus install instructions. This runs in connect() for non-remote modes before any adapter is created.","triggerScenarios":"Calling browser_connect with a browser name that discovery did not flag as available (no executable path, not installed, or unsupported). Also when defaultBrowser points at a browser that was uninstalled since discovery ran.","commonSituations":"Chrome/Brave/Edge/Chromium not installed on the host. Browser installed but not in a standard location and executablePath not configured. Wrong browser name string passed (case mismatch, typo). Headless server with no browser binaries.","solutions":["Install a compatible Chromium-based browser (Chrome, Brave, Edge, or Chromium).","Call browser_connect with one of the browsers listed in the error's hint (availableBrowsers).","Provide an explicit executablePath in the config for a non-standard install location.","For servers, use remote mode (config.mode='remote') with an external CDP endpoint."],"exampleFix":"// before — requested browser not installed\nawait connection.connect('firefox'); // throws BrowserNotAvailableError\n\n// after — use an available browser or remote mode\nconst avail = connection.getAvailableBrowsers();\nawait connection.connect(avail[0]);\n// or: config.mode = 'remote' with externalCdpEndpoint","handlingStrategy":"validation","validationCode":"const available = connection.getAvailableBrowsers();\nif (!available.includes(browser)) {\n  browser = available[0]; // or throw with install instructions\n}","typeGuard":"function browserAvailable(c: BrowserConnection, name: BrowserName): boolean {\n  return c.getAvailableBrowsers().includes(name);\n}","tryCatchPattern":null,"preventionTips":["Call getAvailableBrowsers() and pick from the returned list.","For servers, use remote mode with an external CDP endpoint.","Provide explicit executablePath for non-standard browser installs."],"tags":["browser-not-available","discovery","config","install"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}