microapps / gatsby-plugin-react-i18next

Easily translate your Gatsby website into multiple languages
MIT License
121 stars 72 forks source link

SSR hydration error with redirect: true #171

Open aureldussauge opened 1 year ago

aureldussauge commented 1 year ago

How to reproduce :

The redirection is causing a hydration error

image
aureldussauge commented 1 year ago

Is it because the language is only checked at browser-side, so the redirect isn't detected at server-side then Gatsby sees a difference between the server-rendered page (/) and the actual page (/fr) ?

madfcat commented 1 year ago

Same issue.

After switching the language from the main language (for example, thewebsite.com), it will now redirect me to thewebsite.com/es/ for example. Now when the second language is remembered as a choice, when If I try to access the website directly typing its URL (thewebsite.com) without language path, it gives 2 errors Error #418 and Error #423:

react-dom.production.min.js:132 Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at fa (react-dom.production.min.js:132:198)
    at qu (react-dom.production.min.js:226:193)
    at ks (react-dom.production.min.js:281:85)
    at bs (react-dom.production.min.js:280:450)
    at vs (react-dom.production.min.js:280:320)
    at gs (react-dom.production.min.js:280:180)
    at ls (react-dom.production.min.js:268:209)
    at S (scheduler.production.min.js:13:203)
    at MessagePort.T (scheduler.production.min.js:14:128)
fa @ react-dom.production.min.js:132
qu @ react-dom.production.min.js:226
ks @ react-dom.production.min.js:281
bs @ react-dom.production.min.js:280
vs @ react-dom.production.min.js:280
gs @ react-dom.production.min.js:280
ls @ react-dom.production.min.js:268
S @ scheduler.production.min.js:13
T @ scheduler.production.min.js:14
react-dom.production.min.js:293 Uncaught Error: Minified React error #423; visit https://reactjs.org/docs/error-decoder.html?invariant=423 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at xi (react-dom.production.min.js:293:39)
    at bs (react-dom.production.min.js:280:389)
    at vs (react-dom.production.min.js:280:320)
    at gs (react-dom.production.min.js:280:180)
    at as (react-dom.production.min.js:271:88)
    at ls (react-dom.production.min.js:268:429)
    at S (scheduler.production.min.js:13:203)
    at MessagePort.T (scheduler.production.min.js:14:128)
grgcnnr commented 1 year ago

I'm also experience this.

Binibeno commented 5 months ago

I’m still having the same issue.