vitest-dev/vitest · error · Error
Browser " " is not supported by the browser provider " "…
Error message
${name}Browser "${browser}" is not supported by the browser provider "${options.provider.name}". Supported browsers: ${supportedBrowsers.join(', ')}. What it means
Thrown when the configured browser name (e.g. "firefox") is not in the resolved provider's supportedBrowser list. Each provider declares which browser engines it can drive; asking for one it cannot yields this error with the exact list of accepted names.
Solutions
- Read the 'Supported browsers:' list in the error message and set test.browser.instances[].browser (or test.browser.name) to one of those exact strings.
- Confirm the provider matches the engine family — playwright supports chromium/firefox/webkit; webdriverio supports a different set.
- If you need a browser the provider lacks, switch the provider field to one that supports it.
Example fix
// before
export default defineConfig({ test: { browser: { name: 'safari', provider: 'playwright' } } })
// after
export default defineConfig({ test: { browser: { name: 'webkit', provider: 'playwright' } } }) Defensive patterns
Strategy: validation
Validate before calling
const PLAYWRIGHT_BROWSERS = ['chromium', 'firefox', 'webkit']
function assertBrowserSupported(name, supported = PLAYWRIGHT_BROWSERS) {
if (!supported.includes(name)) {
throw new Error(`Browser "${name}" not supported. Use one of: ${supported.join(', ')}.`)
}
} Type guard
const SUPPORTED = ['chromium', 'firefox', 'webkit'] as const
function isSupportedBrowser(v): v is typeof SUPPORTED[number] {
return (SUPPORTED as readonly string[]).includes(v)
} Prevention
- Pin browser names to the provider's documented list in a shared constant.
- Treat the error message's 'Supported browsers' list as the source of truth.
- Avoid free-text browser names from env vars without validation.
When it happens
Trigger: getBrowserProvider reaches the supportedBrowsers check after options.provider is set, and project.config.browser.name (e.g. 'safari', 'edge') is not included in options.provider.supportedBrowser.
Common situations: Typo in the browser name; using playwright's name with the webdriverio provider or vice-versa; requesting 'safari' (not supported) instead of 'webkit'; case mismatch like 'Chromium' vs 'chromium'.
Related errors
- All browser instances within a project must use the same…
- browser is not initialized
- Browser Mode requires the "provider" to always be specified.
- Browser Mode was enabled, but provider was not specified…
- The `browser.provider` configuration was changed to accept…
AI-assisted analysis of vitest-dev/vitest@1fa9837ec2 (2026-08-11).
Data as JSON: /api/errors/35124b6fcf98922a.
Report an issue: GitHub.
Appendix: source
Thrown at packages/browser/src/node/utils.ts:84
}
export async function getBrowserProvider(
options: ResolvedBrowserOptions,
project: TestProject,
): Promise<BrowserProvider> {
const browser = project.config.browser.name
const name = project.name ? `[${project.name}] ` : ''
if (!browser) {
throw new Error(
`${name}Browser name is required. Please, set \`test.browser.instances[].browser\` option manually.`,
)
}
if (options.provider == null) {
throw new Error(`Browser Mode requires the "provider" to always be specified.`)
}
const supportedBrowsers = options.provider.supportedBrowser || []
if (supportedBrowsers.length && !supportedBrowsers.includes(browser)) {
throw new Error(
`${name}Browser "${browser}" is not supported by the browser provider "${
options.provider.name
}". Supported browsers: ${supportedBrowsers.join(', ')}.`,
)
}
if (typeof options.provider.providerFactory !== 'function') {
throw new TypeError(`The "${name}" browser provider does not provide a "providerFactory" function. Received ${typeof options.provider.providerFactory}.`)
}
return options.provider.providerFactory(project)
}
export function slash(path: string): string {
return path.replace(/\\/g, '/').replace(/\/+/g, '/')
}
export function assertBrowserFileAccess(project: TestProject, path: string): void {
const normalized = slash(path)
if (View on GitHub (pinned to 1fa9837ec2)