{"record":{"id":"6e03ea2f52074e85","repo":"vuetifyjs/vuetify","slug":"could-not-find-vuetify-theme-injection","errorCode":null,"errorMessage":"Could not find Vuetify theme injection","messagePattern":"Could not find Vuetify theme injection","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/vuetify/src/composables/theme.ts","lineNumber":650,"sourceCode":"    themes,\n    current,\n    computedThemes,\n    prefix: parsedOptions.prefix,\n    themeClasses,\n    styles,\n    global: {\n      name: globalName,\n      current,\n    },\n  }\n}\n\nexport function provideTheme (props: { theme?: string }) {\n  getCurrentInstance('provideTheme')\n\n  const theme = inject(ThemeSymbol, null)\n\n  if (!theme) throw new Error('Could not find Vuetify theme injection')\n\n  const name = toRef(() => props.theme ?? theme.name.value)\n  const current = toRef(() => theme.computedThemes.value[name.value])\n\n  const themeClasses = toRef(() => theme.isDisabled ? undefined : `${theme.prefix}theme--${name.value}`)\n\n  const newTheme: ThemeInstance = {\n    ...theme,\n    name,\n    current,\n    themeClasses,\n  }\n\n  provide(ThemeSymbol, newTheme)\n\n  return newTheme\n}\n","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/vuetifyjs/vuetify/blob/8d153908dffb7592eb389ddbfbab955a0ccc977f/packages/vuetify/src/composables/theme.ts#L632-L668","documentation":"provideTheme() injects ThemeSymbol with a null default. ThemeSymbol is provided app-wide by createVuetify() (theme.install in framework.ts:84-90) and re-provided by provideTheme itself. It throws when no theme was ever injected, i.e. Vuetify is not installed on the app.","triggerScenarios":"Calling provideTheme() (used by any component that scopes a theme, e.g. via a theme prop) on an app that never ran app.use(createVuetify()).","commonSituations":"Vuetify plugin not installed; theme.install disabled or skipped; second app instance without Vuetify; test without createVuetify().","solutions":["Call app.use(createVuetify()) so the global theme is provided.","Avoid disabling theme.install unless you provide ThemeSymbol yourself.","Install Vuetify in every app and in the test harness."],"exampleFix":"// before\nconst app = createApp(App)\napp.mount('#app')\n\n// after\nconst app = createApp(App)\napp.use(createVuetify())\napp.mount('#app')","handlingStrategy":"validation","validationCode":"import { inject } from 'vue'\nimport { ThemeSymbol } from 'vuetify'\nconst theme = inject(ThemeSymbol, null)\nif (!theme) {\n  // Vuetify not installed: do not call provideTheme; report a config error.\n}","typeGuard":"import { inject } from 'vue'\nimport { ThemeSymbol } from 'vuetify'\nexport function hasTheme (): boolean {\n  return inject(ThemeSymbol, null) != null\n}","tryCatchPattern":null,"preventionTips":["Install createVuetify() so the global theme is provided.","Do not disable theme.install without providing ThemeSymbol yourself.","Register Vuetify in every app and the test harness."],"tags":["injection","theme","config"],"backgroundTag":null,"analyzedSha":"8d153908dffb7592eb389ddbfbab955a0ccc977f","analyzedAt":"2026-08-12T21:54:20.596Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}