{"id":"35124b6fcf98922a","repo":"vitest-dev/vitest","slug":"name-browser-browser-is-not-supported-by-th","errorCode":null,"errorMessage":"${name}Browser \"${browser}\" is not supported by the browser provider \"${options.provider.name}\". Supported browsers: ${supportedBrowsers.join(', ')}.","messagePattern":"(.+?)Browser \"(.+?)\" is not supported by the browser provider \"(.+?)\"\\. Supported browsers: (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser/src/node/utils.ts","lineNumber":84,"sourceCode":"}\n\nexport async function getBrowserProvider(\n  options: ResolvedBrowserOptions,\n  project: TestProject,\n): Promise<BrowserProvider> {\n  const browser = project.config.browser.name\n  const name = project.name ? `[${project.name}] ` : ''\n  if (!browser) {\n    throw new Error(\n      `${name}Browser name is required. Please, set \\`test.browser.instances[].browser\\` option manually.`,\n    )\n  }\n  if (options.provider == null) {\n    throw new Error(`Browser Mode requires the \"provider\" to always be specified.`)\n  }\n  const supportedBrowsers = options.provider.supportedBrowser || []\n  if (supportedBrowsers.length && !supportedBrowsers.includes(browser)) {\n    throw new Error(\n      `${name}Browser \"${browser}\" is not supported by the browser provider \"${\n        options.provider.name\n      }\". Supported browsers: ${supportedBrowsers.join(', ')}.`,\n    )\n  }\n  if (typeof options.provider.providerFactory !== 'function') {\n    throw new TypeError(`The \"${name}\" browser provider does not provide a \"providerFactory\" function. Received ${typeof options.provider.providerFactory}.`)\n  }\n  return options.provider.providerFactory(project)\n}\n\nexport function slash(path: string): string {\n  return path.replace(/\\\\/g, '/').replace(/\\/+/g, '/')\n}\n\nexport function assertBrowserFileAccess(project: TestProject, path: string): void {\n  const normalized = slash(path)\n  if (","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/browser/src/node/utils.ts#L66-L102","documentation":"Thrown when the requested browser name is not in the provider's supportedBrowser list. Each provider declares which browser engines it can drive; requesting an unsupported one means the provider has no way to launch it.","triggerScenarios":"Passing a browser name the provider doesn't recognize, e.g. 'safari' (the engine is 'webkit'), or 'chrome' (the engine is 'chromium') with the playwright provider, or any name absent from provider.supportedBrowser.","commonSituations":"Using colloquial browser names ('safari', 'chrome', 'edge') instead of the engine names playwright expects ('webkit', 'chromium'); writing a custom provider and forgetting to add an engine to supportedBrowser.","solutions":["Use the exact engine name the provider lists in its error message (chromium, firefox, webkit for playwright).","For a custom provider, extend its supportedBrowser array to include the engine you request.","Switch to a provider that supports your target engine."],"exampleFix":"// before\nexport default defineConfig({\n  test: {\n    browser: {\n      provider: 'playwright',\n      instances: [{ browser: 'safari' }],\n    },\n  },\n})\n// after\nexport default defineConfig({\n  test: {\n    browser: {\n      provider: 'playwright',\n      instances: [{ browser: 'webkit' }],\n    },\n  },\n})","handlingStrategy":"validation","validationCode":"const PLAYWRIGHT = ['chromium', 'firefox', 'webkit']\nconst requested = 'safari'\nif (!PLAYWRIGHT.includes(requested)) {\n  throw new Error(`Use one of: ${PLAYWRIGHT.join(', ')} (got '${requested}')`)\n}","typeGuard":"function isSupportedBrowser(name: string, supported: string[]): name is string {\n  return supported.includes(name)\n}","tryCatchPattern":null,"preventionTips":["Use engine names (chromium/firefox/webkit), not product names (chrome/safari/edge).","Read the provider's supportedBrowser list before choosing instance names.","For custom providers, document and assert the supportedBrowser contract."],"tags":["browser-mode","config","playwright","webdriverio"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}