Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tReady is false, and will never update to true in version 4.4.2 #2305

Open
qingbolove opened this issue Nov 27, 2024 · 5 comments
Open

tReady is false, and will never update to true in version 4.4.2 #2305

qingbolove opened this issue Nov 27, 2024 · 5 comments

Comments

@qingbolove
Copy link

🐛 Bug Report

tReady is false, and will never update to true in version 4.4.2.

To Reproduce

Keep switch country language for several times, and could reproduce this issue,

let thisLocalePath = "/static/data/locales";
// config
if (process.browser) {
  const { publicRuntimeConfig } = getConfig();
  thisLocalePath = publicRuntimeConfig.isUsingCDN ? `${publicRuntimeConfig.cdnDomain}/static/data/locales` : "/static/data/locales";
}

let _instance = new NextI18Next({
  otherLanguages: ["de", "zh", "ja", "ko","es", 'nl'],
  defaultLanguages: "en",
  defaultNS: [`common${VERSION_COMMON}`],
  ns: [
    `common${VERSION_COMMON}`,
    `contact${VERSION_CONTACT}`,
    `content${VERSION_CONTENT}`,
    `footer${VERSION_FOOTER}`,
    `header${VERSION_HEADER}`,
    `shipping${VERSION_SHIPPING}`,
    `policy${VERSION_POLICY}`,
    `terms${VERSION_TERMS}`,
    `navigation${VERSION_NAVIGATION}`
  ],
  localePath: thisLocalePath,
  shallowRender: false,
  react: {
    useSuspense: false
  }
});

Expected behavior

tReady need to update to true after i18n is set up

// Paste the expected results here

Your Environment

  • i18next version: i.e. 4.4.2
  • os: Mac,
  • any other relevant information
@adrai
Copy link
Member

adrai commented Nov 27, 2024

v4.4.2 of what?
next-i18next is at 15.4.0 and i18next is at 24.0.2 and react-i18next is at 15.1.2

Please provide more information and a minimal reproducible example exactly showing your issue... Not just code snippets.

@qingbolove
Copy link
Author

Hi adrai, next-i18next is v4.4.2, other related version message is like: "i18next": "^14.0.1","next": "~7.0.2", "react-i18next": "^11.0.0". Yes, we are using a old version, and when we keep switch language from UI, we could reproduce this issue, not 100%, but we could repro once if we tried several times. I18n is a blocking process for the project, so we will encounter a page hang, and nothing could show up if tReady keeps false not change to true. Please help investigate, thanks.

@adrai
Copy link
Member

adrai commented Nov 28, 2024

Sorry, but your versions are way too old.
You need to update them first.

@qingbolove
Copy link
Author

Is there any chance we could resolve this issue without upgrade version? We are a big project, and it may take a while if we want to upgrade our project versions. Could I know why the current version have this issue? I could not see any error message in console for next-i18next, but the log shows up that tReady is false, and never got update to true.

@adrai
Copy link
Member

adrai commented Nov 28, 2024

Hard to help without a minimal reproducible example, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants