-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Infiinite loop caused #673
Comments
please provide a https://codesandbox.io/s/l4qrory2nl to reproduce 99.9% sure not related to this module but to either your code or misconfiguration |
If it can help, I had a similar issue when I set a |
please start adding changes related to the v9 version to the v9.x.x branch (master will be now for the upcoming v10 hooks) --> https://github.com/i18next/react-i18next/tree/v9.x.x |
I'm getting an infinite loop when the backend fails to load. Probably related, but I'm using alpha v10. |
@cthurston with current published react-i18next@10.0.0-alpha.1? or an old v9 think i fixed that...376fe57#diff-cfd6b2fa22409acc10b6dab14d52cdb1R51 |
I'm using the current published react-i18next@10.0.0-alpha.1. For some reason it is sending an empty languages array. This causes ready to always be false. Near line 45 in useTranslation. If I put a guard in the every callback, it seems not to crash.
Until I added the languagedetector back in. Then it hit an infinite loop again. For now I'm just returning true from the callback, seems to work. |
can you paste your i18next options? wondering how i18n.languages can be empty after init |
|
strange if |
const ready =
i18n.isInitialized &&
namespaces.every(n => {
const ret =
i18n.hasResourceBundle(i18n.languages[0], n) || So guess it's an empty array...i'm confused |
ah...if not using a detector you need to set Wonder if we should force taking the fallbackLng as lng if not set by user -> seems not to be clear it has to be set when not using a detector?!? ok if backend fails completely it will never get ready - will make a check for everything failing to load |
@cthurston might be fixed in react-i18next@10.0.0-alpha.2 |
closing for now...feel free to provide a sample to reproduce. |
I keep getting infinite loop errors when using the HOC 'withNamespaces'
I put it on a child component of a page that is also translated.
The text was updated successfully, but these errors were encountered: