vuetifyjs/vuetify · critical · Error
Could not find Vuetify theme injection
Error message
Could not find Vuetify theme injection
What it means
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.
Source
Thrown at packages/vuetify/src/composables/theme.ts:650
themes,
current,
computedThemes,
prefix: parsedOptions.prefix,
themeClasses,
styles,
global: {
name: globalName,
current,
},
}
}
export function provideTheme (props: { theme?: string }) {
getCurrentInstance('provideTheme')
const theme = inject(ThemeSymbol, null)
if (!theme) throw new Error('Could not find Vuetify theme injection')
const name = toRef(() => props.theme ?? theme.name.value)
const current = toRef(() => theme.computedThemes.value[name.value])
const themeClasses = toRef(() => theme.isDisabled ? undefined : `${theme.prefix}theme--${name.value}`)
const newTheme: ThemeInstance = {
...theme,
name,
current,
themeClasses,
}
provide(ThemeSymbol, newTheme)
return newTheme
}
View on GitHub (pinned to 8d153908df)
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.
Example fix
// before
const app = createApp(App)
app.mount('#app')
// after
const app = createApp(App)
app.use(createVuetify())
app.mount('#app') Defensive patterns
Strategy: validation
Validate before calling
import { inject } from 'vue'
import { ThemeSymbol } from 'vuetify'
const theme = inject(ThemeSymbol, null)
if (!theme) {
// Vuetify not installed: do not call provideTheme; report a config error.
} Type guard
import { inject } from 'vue'
import { ThemeSymbol } from 'vuetify'
export function hasTheme (): boolean {
return inject(ThemeSymbol, null) != null
} Prevention
- 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.
When it happens
Trigger: 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()).
Common situations: Vuetify plugin not installed; theme.install disabled or skipped; second app instance without Vuetify; test without createVuetify().
Related errors
- [Vuetify] Could not find injected locale instance
- [Vuetify] Could not find injected rtl instance
- Missing Vuetify Icons provide!
- foo
- Missing group!
AI-assisted analysis of vuetifyjs/vuetify@8d153908df (2026-08-12).
Data as JSON: /api/errors/6e03ea2f52074e85.
Report an issue: GitHub.