N
Nuxt2y ago
Furnaxe

How to use "useI18n" on "server/api" directory

I have this error when i try to use I18n on /server/api :
500
Cannot access 'renderer$1' before initialization
500
Cannot access 'renderer$1' before initialization
2 Replies
AngeloK
AngeloK2y ago
Im not sure but can you access nuxtApp on server routes?
const nuxtApp = useNuxtApp()
const nuxtApp = useNuxtApp()
If so, you could access it like thse:
nuxtApp.vueApp.$nuxt.$i18n
nuxtApp.vueApp.$nuxt.$i18n
xibman
xibman2y ago
const nuxtApp = useNuxtApp() nuxtApp.$i18n for access
Want results from more Discord servers?
Add your server