i18n icon indicating copy to clipboard operation
i18n copied to clipboard

[next] "The message format compilation is not supported in this build" when generating page

Open timgoeller opened this issue 3 years ago • 1 comments

Version

@nuxtjs/i18n: i18n-edge nuxt: 3.0.0-rc.6

Nuxt configuration

Please change to [x] if relevant for this issue:

  • [x] Applies to a site deployed to a static server (site generated with nuxt generate)
  • [ ] Applies to a site deployed to a server with a Node backend

@nuxtjs/i18n configuration

  i18n: {
    vueI18n: {
      fallbackLocale: 'de',
      legacy: false,
      messages: {
        en: {
          hello: 'Hello, I am translated',
        },
        de: {
          hello: 'Hallo, ich bin übersetzt',
        }
      },
    },
  }

Reproduction Link

https://github.com/timgoeller/nuxt-i18n-bug

Steps to reproduce

Add messages to the messages attribute of vueI18n.

What is Expected?

Translations working correctly.

What is actually happening?

The error message The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return 'hello'. appears during generation phase, and the page will throw an error (e.$t is not a function) when trying to start the generated page.

timgoeller avatar Aug 09 '22 07:08 timgoeller

Actually, this error seems to appear in the dev server aswell with rc-6

timgoeller avatar Aug 09 '22 07:08 timgoeller

I've already fixed this commit https://github.com/nuxt-community/i18n-module/commit/0923cac104ff0a8b72d59b5805ee37b96004a9ec

You can try to use latest edge version :) Thanks!

kazupon avatar Aug 28 '22 13:08 kazupon