@nuxtjs/i18n works in development(dev) but fails in production (build)

106 views Asked by At

I'm using "@nuxtjs/i18n": "^8.0.0-rc.4" with the following config:

export default defineI18nConfig(() => ({
    legacy: false,
    globalInjection: true,
    locale: "fa",
    messages: {
        en: {
            Categories: "Categories",
        },
        fa: {
            Categories: "دسته‌بندی‌ها",
        },
    },
}));

it works pretty good in dev but fails in build.

the error messages that appears in browser: Cannot read properties of undefined (reading 't')

the error disappeared when i delete all $t functions or delete the messages block like this: messages: {}

any suggestion can be helpful.

0

There are 0 answers