vitest-dev/vitest · error · Error
Unsupported framework
Error message
Unsupported framework: ${framework} What it means
The `vitest-browser` project creator CLI (packages/vitest/src/create/browser/creator.ts) scaffolds a browser component-testing project for a known UI framework. getFrameworkTestPackage maps the framework name to its testing-library/adapter package. An unrecognized framework string falls through the switch to this error.
Solutions
- Use one of the supported framework names: vue, svelte, react, lit, preact, solid, marko, qwik, or vanilla.
- Check for typos and case sensitivity in the framework argument.
- Upgrade Vitest — newer versions may add support for your framework.
Example fix
// before: npx vitest-browser create --framework angular // after — use a supported framework or vanilla: npx vitest-browser create --framework vanilla
Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = ['vue','svelte','react','lit','preact','solid','marko','qwik','vanilla']
if (!SUPPORTED.includes(framework)) {
throw new Error(`Supported frameworks: ${SUPPORTED.join(', ')}`)
} Type guard
function isSupportedFramework(f: string): f is 'vue'|'svelte'|'react'|'lit'|'preact'|'solid'|'marko'|'qwik'|'vanilla' {
return ['vue','svelte','react','lit','preact','solid','marko','qwik','vanilla'].includes(f)
} Prevention
- Check supported framework names in the CLI help before passing --framework.
- Keep Vitest updated for newly added framework support.
When it happens
Trigger: Passing a framework name not in the supported set (vue, svelte, react, lit, preact, solid, marko, qwik, vanilla) to the browser project creator — e.g. a typo like 'Reat' or an unsupported framework like 'angular'.
Common situations: Typo in the framework argument; using a framework Vitest's browser creator doesn't yet support; outdated Vitest version that predates a newly added framework.
Related errors
- "browser.instances" was set in the config, but the array is…
- Vitest received --browser flag, but no project had a…
- Access denied to " ". See Vite config documentation for…
- All browser instances within a project must use the same…
- aria adapter expects an Element
AI-assisted analysis of vitest-dev/vitest@1fa9837ec2 (2026-08-11).
Data as JSON: /api/errors/1986627a4402e163.
Report an issue: GitHub.
Appendix: source
Thrown at packages/vitest/src/create/browser/creator.ts:114
return null
case 'vue':
return 'vitest-browser-vue'
case 'svelte':
return 'vitest-browser-svelte'
case 'react':
return 'vitest-browser-react'
case 'lit':
return 'vitest-browser-lit'
case 'preact':
return 'vitest-browser-preact'
case 'solid':
return '@solidjs/testing-library'
case 'marko':
return '@marko/testing-library'
case 'qwik':
return 'vitest-browser-qwik'
}
throw new Error(`Unsupported framework: ${framework}`)
}
function getFrameworkPluginPackage(framework: string) {
switch (framework) {
case 'vue':
return '@vitejs/plugin-vue'
case 'svelte':
return '@sveltejs/vite-plugin-svelte'
case 'react':
return '@vitejs/plugin-react'
case 'preact':
return '@preact/preset-vite'
case 'solid':
return 'vite-plugin-solid'
case 'marko':
return '@marko/vite'
case 'qwik':
return '@builder.io/qwik/optimizer'View on GitHub (pinned to 1fa9837ec2)