nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.76k stars 485 forks source link

[Vue warn]: Hydration text content mismatch in <div> in SSR #2300

Closed n4an closed 1 year ago

n4an commented 1 year ago

Environment

Nuxi 3.6.5

RootDir: /home/demo
Nuxt project info:


Reproduction

i18n: {
    // vueI18n: './i18n.config.ts'
    defaultLocale: 'en',
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: 'i18n_redirected',
      // onlyOnRoot: true,
    },
    langDir: 'locales',
    // lazy: true,
    locales: [
      {
        code: 'en',
        file: 'en.json',
        iso: 'en-US',
        name: 'English',
      },
      {
        code: 'ru',
        file: 'ru.json',
        iso: ' ru-Ru',
        name: 'Русский',
      }
    ],
    noPrefixDefaultLocale: false,
    customRoutes: 'config',
    // parsePages: false,
    seo: false,
    strategy: 'prefix',
    // vueI18n: {
    //   fallbackLocale: 'en',
    //   // silentFallbackWarn: true,
    // },
    // vueI18nLoader: true,
  },

Describe the bug

[Vue warn]: Hydration text content mismatch in

Additional context

No response

Logs

No response

n4an commented 1 year ago

In terminal it write [intlify] Not found 'Hello' key in 'ru' locale messages., but after hidration it chage text to needed

kazupon commented 1 year ago

I've backed from short vacation.

Thank you for your reporting! To continue for debugging, We need a minimum reproduction code .

As mentioned in the issue guideline, we need minimal reproduction:

Please use a template below to create a minimal reproduction, and provide to us your issue cases 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz

https://github.com/nuxt-modules/i18n/issues/new?assignees=&labels=pending+triage&projects=&template=bug-report.yml

Could you please provide a minimum reproduction in stackbliz or github repo? 🙏

Me-Phew commented 1 year ago

I think this is related to vuetify.

Here is a reproduction

Maybe this is also related to this issue because it looks exactly the same.

kazupon commented 1 year ago

@Me-Phew Yes. Your reproduction case is caused by vue-i18n version. That version is installed v9.2.2

Me-Phew commented 1 year ago

So is there any other fix or a workaround other than using yarn?

AnthonyRuelle commented 1 year ago

Same issue here locally .. Not related to vuetify @kazupon i vue-i18n v9.2.2 is the latest ..

nothing has changed on this side concerning me, the problem has been present since I left the version v8.0.0-beta.12

kazupon commented 1 year ago

I think you can work-around with override of package manager, such as overrides or resolution

When vue-i18n v9.3 will officially release, maybe I think vuetify and other ecosystem will support it. I believe that we will not face this issue.

Me-Phew commented 1 year ago

Thanks I fixed it for now by setting "overrides": { "vue-i18n": "9.3.0-beta.24" } in package.json

kazupon commented 1 year ago

close in-activity. if you have still issue, please you would open the issue as new.

thanks!