Open PreethiVS21 opened 7 months ago
Hearing this for the first time... Maybe a problem of your deployment environment? Or is this reproducible also locally? Please provide more information.
Yes, I can reproduce it locally. Similar comment was addressed here. Can you confirm if this is needed whenever we need to get translations from getServerSideProps https://github.com/vercel/next.js/issues/46730#issuecomment-1489654441
seems the way Next.js handles this... yes
@PreethiVS21 Have you figured out how to fix it? I have also encountered this issue. I have utilized Page Router, and below are the versions of the packages I am currently using:
"i18next": "^23.8.2",
"next-i18next": "^15.2.0",
"next": "^13.5.6"
I've found I can reproduce this locally fairly easily. In our case, we are using a custom Docker image. Simply rebuilding the image and redeploying it is enough to break the translations.
Steps:
I can see that Next is fetching a translations file on every page transition. For instance, every time I navigate to Page A, it will fetch /_next/data/tfbRnBfT3Y6OXf7Afbrm1/en/PageA/6632778e658b8005459f8503.json
, and every time I go to Page B, it will fetch /_next/data/tfbRnBfT3Y6OXf7Afbrm1/en/PageB/99125246-21fc-4742-876c-e7d3b9a52bcc.json
. But after a redeploy, those two URLs return an empty translation list: {}
. Presumably this is because the Next BUILD_ID
has changed. If I do a full reload, the pages fetch slightly different URLs, like: /_next/data/eCtPEywIx-3IoSgG-JHVF/en/PageA/6632778e658b8005459f8503.json
. (Note that the old BUILD_ID
tfbRnBfT3Y6OXf7Afbrm1
has been replaced with eCtPEywIx-3IoSgG-JHVF
).
Anyways, it seems I need a way to detect that there's a new BUILD_ID
in play and force next to do a full-page-load transition.
@PreethiVS21 @Sarawut-keng any updates guys? same issue on the same next version 13.5.6 (pages router) @adrai @jgregory-apogee
@adrai getServerSideProps totally doesnt work after couple of hours, its ok with getStaticProps
@adrai getServerSideProps totally doesnt work after couple of hours, its ok with getStaticProps
If that's the case you may ask the Next.js team...
@BrilliantDecision after reviewing the case, I have figured out that @jgregory-apogee ’s comment was correct. After my CD re-deployment, the language broke. I am not sure if this occurs only on the page router. Right now, we do not have the best solution yet. We have just briefed users that we have updated to a new version and that they need to refresh the screen.
@Sarawut-keng and how do you implement this notification, what do you use for this? how do you understand that you need to refresh the page? some error catcher?
We have the exact same problem here. i18n store is empty on after some deployments even the translation files are exist.
🐛 Bug Report
in next-i18next version 13.2.2, When translations are rendered using getServerSideProps (next 13.5-pages router) , translations doesn't happen after couple of hours. I can only see key names .
To Reproduce
next-i18next.config.js
index.tsx
Expected behavior
Translations shouldn't fail intermittently
Your Environment