vuetifyjs/vuetify · critical · Error
[Vuetify] Could not find defaults instance
Error message
[Vuetify] Could not find defaults instance
What it means
Thrown by injectDefaults() when inject(DefaultsSymbol) returns undefined. The defaults ref is created and provided by createVuetify() (it lives on the Vuetify instance). Without the Vuetify plugin installed, useDefaults()/injectDefaults() cannot find it.
Source
Thrown at packages/vuetify/src/composables/defaults.ts:27
import type { MaybeRef } from '@/util'
export type DefaultsInstance = undefined | {
[key: string]: undefined | Record<string, unknown>
global?: Record<string, unknown>
}
export type DefaultsOptions = Partial<DefaultsInstance>
export const DefaultsSymbol: InjectionKey<Ref<DefaultsInstance>> = Symbol.for('vuetify:defaults')
export function createDefaults (options?: DefaultsInstance): Ref<DefaultsInstance> {
return ref(options)
}
export function injectDefaults () {
const defaults = inject(DefaultsSymbol)
if (!defaults) throw new Error('[Vuetify] Could not find defaults instance')
return defaults
}
export function provideDefaults (
defaults?: MaybeRef<DefaultsInstance | undefined>,
options?: {
disabled?: MaybeRef<boolean | undefined>
reset?: MaybeRef<number | string | undefined>
root?: MaybeRef<boolean | string | undefined>
scoped?: MaybeRef<boolean | undefined>
}
) {
const injectedDefaults = injectDefaults()
const providedDefaults = ref(defaults)
const newDefaults = computed(() => {
const disabled = unref(options?.disabled)View on GitHub (pinned to 8d153908df)
Solutions
- Install Vuetify on the app: `app.use(createVuetify(...))`.
- Ensure components using useDefaults() are rendered under that app's root.
- For multi-app setups, install Vuetify on every app instance that needs defaults.
Example fix
// before
createApp(App).mount('#app')
// after
import { createVuetify } from 'vuetify'
const vuetify = createVuetify()
createApp(App).use(vuetify).mount('#app') Defensive patterns
Strategy: type-guard
Validate before calling
import { inject } from 'vue'
import { DefaultsSymbol } from 'vuetify/composables/defaults'
function vuetifyInstalled(): boolean {
return inject(DefaultsSymbol, null) != null
} Type guard
import { inject } from 'vue'
import { DefaultsSymbol } from 'vuetify/composables/defaults'
function hasDefaultsProvider(): boolean {
return inject(DefaultsSymbol, null) != null
} Try / catch
try {
injectDefaults()
} catch (e) {
if (e instanceof Error && /Could not find defaults instance/.test(e.message)) {
// install Vuetify, or supply an empty defaults ref
} else throw e
} Prevention
- Mount Vuetify before any component using useDefaults().
- For multi-app setups, install Vuetify per app.
- Avoid duplicate Vuetify installs.
When it happens
Trigger: Calling useDefaults() or injectDefaults() in an app where createVuetify() was never installed (app.use(vuetify)), or in a component mounted outside the Vuetify-providing app root.
Common situations: Forgetting app.use(vuetify), rendering a Vuetify component in a micro-frontend/separate createApp without installing Vuetify there, SSR misconfiguration, or duplicate Vuetify installs where the providing instance differs from the rendering one.
Related errors
- [Vuetify] Could not find injected date options
- Could not find Vuetify display injection
- [Vuetify] Could not find injected goto instance
- [Vuetify] Could not determine component name
- [Vuetify] Could not find useGroup injection with symbol ${in
AI-assisted analysis of vuetifyjs/vuetify@8d153908df (2026-08-12).
Data as JSON: /api/errors/2f0376c1edafea90.
Report an issue: GitHub.