{"id":"1986627a4402e163","repo":"vitest-dev/vitest","slug":"unsupported-framework-framework","errorCode":null,"errorMessage":"Unsupported framework: ${framework}","messagePattern":"Unsupported framework: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vitest/src/create/browser/creator.ts","lineNumber":114,"sourceCode":"      return null\n    case 'vue':\n      return 'vitest-browser-vue'\n    case 'svelte':\n      return 'vitest-browser-svelte'\n    case 'react':\n      return 'vitest-browser-react'\n    case 'lit':\n      return 'vitest-browser-lit'\n    case 'preact':\n      return 'vitest-browser-preact'\n    case 'solid':\n      return '@solidjs/testing-library'\n    case 'marko':\n      return '@marko/testing-library'\n    case 'qwik':\n      return 'vitest-browser-qwik'\n  }\n  throw new Error(`Unsupported framework: ${framework}`)\n}\n\nfunction getFrameworkPluginPackage(framework: string) {\n  switch (framework) {\n    case 'vue':\n      return '@vitejs/plugin-vue'\n    case 'svelte':\n      return '@sveltejs/vite-plugin-svelte'\n    case 'react':\n      return '@vitejs/plugin-react'\n    case 'preact':\n      return '@preact/preset-vite'\n    case 'solid':\n      return 'vite-plugin-solid'\n    case 'marko':\n      return '@marko/vite'\n    case 'qwik':\n      return '@builder.io/qwik/optimizer'","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/vitest-dev/vitest/blob/d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09/packages/vitest/src/create/browser/creator.ts#L96-L132","documentation":"Thrown by getFrameworkTestPackage() in packages/vitest/src/create/browser/creator.ts during the `vitest init` browser scaffolding flow. The function maps a framework name (vanilla/vue/svelte/react/lit/preact/solid/marko/qwik) to the test-renderer package to install; reaching the throw means the framework value is not one of the supported keys. Because the prompt constrains the choice, this usually indicates an externally driven call or a future/typo'd framework name passed into the scaffolder.","triggerScenarios":"Programmatically invoking the create() flow with a framework string outside the supported list; a stale fork of creator.ts whose prompt choices were edited without updating getFrameworkTestPackage; corrupted prompt input returning an unexpected value.","commonSituations":"Contributing a new framework to the scaffolder and forgetting to update the switch; running a patched/older vitest init against a newer prompt list; user typing a custom framework name in a non-interactive invocation.","solutions":["Pick one of the supported frameworks: vanilla, vue, svelte, react, lit, preact, solid, marko, qwik.","If you are extending Vitest, add the new framework to both getFramework() (prompt list) and getFrameworkTestPackage()/getFrameworkPluginPackage().","Update vitest to the latest patch — the framework may have been added in a newer release.","Run vitest init interactively rather than scripting it, so the prompt enforces valid values."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED_FRAMEWORKS = ['vanilla','vue','svelte','react','lit','preact','solid','marko','qwik'] as const\nfunction isSupportedFramework(f: string): f is typeof SUPPORTED_FRAMEWORKS[number] {\n  return (SUPPORTED_FRAMEWORKS as readonly string[]).includes(f)\n}","typeGuard":"const SUPPORTED = new Set(['vanilla','vue','svelte','react','lit','preact','solid','marko','qwik'])\nconst isSupportedFramework = (f: string): boolean => SUPPORTED.has(f)","tryCatchPattern":null,"preventionTips":["Run vitest init interactively so the prompt enforces valid framework choices.","When extending the scaffolder, update both the prompt list and the package/plugin maps.","Update to the latest vitest patch before filing an issue — the framework may already be supported."],"tags":["browser","scaffolding","init","framework"],"analyzedSha":"d568f8ce3739b532d5bf2c1ee1e45e8a8a473d09","analyzedAt":"2026-08-03T20:23:56.861Z","schemaVersion":2}