i18next / i18next-http-backend

i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
MIT License
447 stars 69 forks source link

Client side loading randomly fails... #98

Closed MoOx closed 1 year ago

MoOx commented 1 year ago

🐛 Bug Report

Hi, I followed carefully the NextJS example and have a weird issue: the translation on the client randomly fails (and instead I have translations keys). You can see this in production here [redacted] If you check the top right corner, you have a purple button Se connecter that sometimes shows Header-SignIn. Do you have any clue about this behaviour ? FYI, my project use vercel with a standard next config.

To Reproduce

My project is private but I can add you to the project if you have time to check.

Expected behavior

I do not expected a "random" failure...

One thing I am not sure about is the last "Alternative usage": I don't really understand why there is no need for "ready". I checked the code from the example carefully but didn't notice a thing that I could have missed...

Your Environment

adrai commented 1 year ago

idk... need to see some code or a minimal reproducible example

MoOx commented 1 year ago

Ok. I wasn't able to reproduce outside production. Really annoying. I switched to another i18n solution. Thanks anyway.

eloyra commented 1 year ago

@MoOx I'm having a similar issue. What solution did you use in the end? Did it work better?

MoOx commented 1 year ago

@eloyra next-intl is working great.

eloyra commented 1 year ago

@eloyra next-intl is working great.

I will check it out, thanks!

jamuhl commented 1 year ago

my guess...missing useTranslation (eg. a component that just uses Trans but has no useTranslation hook)

eloyra commented 1 year ago

my guess...missing useTranslation (eg. a component that just uses Trans but has no useTranslation hook)

This is not my case. My issue is entirely related to the HttpBackend because when I load the translations from inside the project they work just fine, but when using the HttpBackend they will fail and only load after a few page reloads if at all.

adrai commented 1 year ago

@eloyra a minimal reproducible example will help to investigate.

eloyra commented 1 year ago

Hey, sorry for the delay, I was cought up in other stuff. In the end I decided to move away from next-i18next and I'm using next-translate, which works as expected. I will try to create a minimal example in the following days, because I like this library better and it would be great getting it to work.