intlify / nuxt3

Nuxt 3 Module for vue-i18n-next

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

messageCompiler is not a function

huuhait opened this issue · comments

Hi team i'm getting this problem in production mode

import { enUS, viVN } from './locales'

  intlify: {
    localeDir: 'locales',
    vueI18n: {
      locale: 'en-US',
      messages: {
        'en-US': {
          ...enUS
        },
      },
    },
  },

locales/enUS.ts

  'page.global.table.favorites': 'Favorites',
  'page.global.table.status': 'Status',
  'page.global.table.name': 'Name',
  'page.global.table.date': 'Date',
  'page.global.table.time': 'Time',
  'page.global.table.pair': 'Pair',
  'page.global.table.coin': 'Coin',
  'page.global.table.currency': 'Currency',
  'page.global.table.infomation': 'Infomation',
  'page.global.table.last_price': 'Last Price',
  'page.global.table.price': 'Price',
  'page.global.table.market': 'Market',
  'page.global.table.change': 'Change',
  'page.global.table.volume': 'Volume',
  'page.global.table.sum': 'Sum',
  'page.global.table.amount': 'Amount',

Thanks for your help

same as #32

same as #32

and not a single response for a month

commented

Facing the same issue with the latest Nuxt 3 Version v3.0.0-27477342.43007c6. When I want to run the build I get the error: TypeError: messageCompiler is not a function

Config:

export default defineNuxtConfig({
  buildModules: ["@intlify/nuxt3"],

  intlify: {
    vueI18n: {
      locale: "en",
      messages: {
        en: {
          hello: "Hello",
        },
        yes: {
          hello: "こんにちは",
        },
      },
    },
  },
});

Has anyone found a solution yet?

I am also getting this error, trying to statically deploy a website. Also just running npx nuxi build && node .output/server/index.mjs and I get this error.

I have fixed this issue on my end. I had to append this into Vista's nuxt 3 plugin:

import { compileToFunction, registerMessageCompiler } from '@intlify/core-base'

registerMessageCompiler(compileToFunction)