vuetifyjs/vuetify · critical · Error

[Vuetify] Could not find injected locale instance

Error message

[Vuetify] Could not find injected locale instance

What it means

provideLocale() injects LocaleSymbol, which createVuetify() installs app-wide during app.use(vuetify) (framework.ts:92). It throws when Vuetify was never installed on that app instance, because there is no parent locale adapter for it to extend and re-provide.

Source

Thrown at packages/vuetify/src/composables/locale.ts:49

}

export const LocaleSymbol: InjectionKey<LocaleInstance & RtlInstance> = Symbol.for('vuetify:locale')

function isLocaleInstance (obj: any): obj is LocaleInstance {
  return obj.name != null
}

export function createLocale (options?: LocaleOptions & RtlOptions) {
  const i18n = options?.adapter && isLocaleInstance(options?.adapter) ? options?.adapter : createVuetifyAdapter(options)
  const rtl = createRtl(i18n, options)

  return { ...i18n, ...rtl }
}

export function useLocale () {
  const locale = inject(LocaleSymbol)

  if (!locale) throw new Error('[Vuetify] Could not find injected locale instance')

  return locale
}

export function provideLocale (props: LocaleOptions & RtlProps) {
  const locale = inject(LocaleSymbol)

  if (!locale) throw new Error('[Vuetify] Could not find injected locale instance')

  const i18n = locale.provide(props)
  const rtl = provideRtl(i18n, locale.rtl, props)

  const data = { ...i18n, ...rtl }

  provide(LocaleSymbol, data)

  return data
}

View on GitHub (pinned to 8d153908df)

Solutions

  1. Call app.use(createVuetify()) on the same app instance before rendering any Vuetify component.
  2. If you use several Vue apps, install createVuetify() on each.
  3. In tests, register createVuetify() on the test app.

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

// Before relying on locale, confirm the plugin ran on this app.
import type { App } from 'vue'
export function isVuetifyInstalled (app: App): boolean {
  const provides = (app._context as any).provides as Record<symbol, unknown>
  return !!provides && Object.getOwnPropertySymbols(provides).length > 0 && !!app._context.app
}
// simplest: ensure app.use(createVuetify()) is in your bootstrap unconditionally.

Type guard

import { inject } from 'vue'
import { LocaleSymbol } from 'vuetify'
export function hasLocale (): boolean {
  return inject(LocaleSymbol, null) != null
}

Prevention

When it happens

Trigger: Calling provideLocale() (used by locale-scoping components such as <v-locale>) before app.use(createVuetify()); calling it in a second Vue app instance that was not registered with Vuetify.

Common situations: Missing app.use(vuetify) at bootstrap; multiple createApp() instances where only one got Vuetify; SSR bootstrap that omits the plugin; test mount that installs components without the Vuetify plugin.

Related errors


AI-assisted analysis of vuetifyjs/vuetify@8d153908df (2026-08-12). Data as JSON: /api/errors/4154f88adb62d855. Report an issue: GitHub.