There was an error while loading. Please reload this page.
1 parent 40ca3df commit 89b7267Copy full SHA for 89b7267
1 file changed
src/runtime/shared/utils.ts
@@ -6,7 +6,10 @@ import type { H3Event } from 'h3'
6
7
export function useRuntimeI18n(nuxtApp?: NuxtApp, event?: H3Event) {
8
if (!nuxtApp) {
9
- return useRuntimeConfig(event).public.i18n as unknown as I18nPublicRuntimeConfig
+ // in nitro `useRuntimeConfig` accepts an event to apply env overrides, while the app-side
10
+ // signature accepts no arguments (https://github.com/nuxt/nuxt/pull/35376) - cast to support both
11
+ const getRuntimeConfig = useRuntimeConfig as (event?: H3Event) => ReturnType<typeof useRuntimeConfig>
12
+ return getRuntimeConfig(event).public.i18n as unknown as I18nPublicRuntimeConfig
13
}
14
return nuxtApp.$config.public.i18n as unknown as I18nPublicRuntimeConfig
15
0 commit comments