{"record":{"id":"4154f88adb62d855","repo":"vuetifyjs/vuetify","slug":"vuetify-could-not-find-injected-locale-instance","errorCode":null,"errorMessage":"[Vuetify] Could not find injected locale instance","messagePattern":"\\[Vuetify\\] Could not find injected locale instance","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/vuetify/src/composables/locale.ts","lineNumber":49,"sourceCode":"}\n\nexport const LocaleSymbol: InjectionKey<LocaleInstance & RtlInstance> = Symbol.for('vuetify:locale')\n\nfunction isLocaleInstance (obj: any): obj is LocaleInstance {\n  return obj.name != null\n}\n\nexport function createLocale (options?: LocaleOptions & RtlOptions) {\n  const i18n = options?.adapter && isLocaleInstance(options?.adapter) ? options?.adapter : createVuetifyAdapter(options)\n  const rtl = createRtl(i18n, options)\n\n  return { ...i18n, ...rtl }\n}\n\nexport function useLocale () {\n  const locale = inject(LocaleSymbol)\n\n  if (!locale) throw new Error('[Vuetify] Could not find injected locale instance')\n\n  return locale\n}\n\nexport function provideLocale (props: LocaleOptions & RtlProps) {\n  const locale = inject(LocaleSymbol)\n\n  if (!locale) throw new Error('[Vuetify] Could not find injected locale instance')\n\n  const i18n = locale.provide(props)\n  const rtl = provideRtl(i18n, locale.rtl, props)\n\n  const data = { ...i18n, ...rtl }\n\n  provide(LocaleSymbol, data)\n\n  return data\n}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/vuetifyjs/vuetify/blob/8d153908dffb7592eb389ddbfbab955a0ccc977f/packages/vuetify/src/composables/locale.ts#L31-L67","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Call app.use(createVuetify()) on the same app instance before rendering any Vuetify component.","If you use several Vue apps, install createVuetify() on each.","In tests, register createVuetify() on the test app."],"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":"// Before relying on locale, confirm the plugin ran on this app.\nimport type { App } from 'vue'\nexport function isVuetifyInstalled (app: App): boolean {\n  const provides = (app._context as any).provides as Record<symbol, unknown>\n  return !!provides && Object.getOwnPropertySymbols(provides).length > 0 && !!app._context.app\n}\n// simplest: ensure app.use(createVuetify()) is in your bootstrap unconditionally.","typeGuard":"import { inject } from 'vue'\nimport { LocaleSymbol } from 'vuetify'\nexport function hasLocale (): boolean {\n  return inject(LocaleSymbol, null) != null\n}","tryCatchPattern":null,"preventionTips":["Always call app.use(createVuetify()) at bootstrap.","Install Vuetify on every createApp() instance.","Register createVuetify() in the test app."],"tags":["injection","locale","i18n","config"],"backgroundTag":null,"analyzedSha":"8d153908dffb7592eb389ddbfbab955a0ccc977f","analyzedAt":"2026-08-12T21:54:20.596Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}