i18next/next-app-dir-i18next-example-ts

Client side hydration errors on first page render

OtisTemler opened this issue ยท 2 comments

๐Ÿ› Bug Report

When the client-page is opened directly with anything but not the fallback lang, there's a hydration error on the first page call. On refresh, the error is gone.

Running

console.log('Resolved lang', i18next.resolvedLanguage)

On the client-page/page.tsx, indicates that on the first server render, the resolved lang is en. Only after the first refresh, the server side render resolves correctly to de from the start.

To Reproduce

  1. Clone next-13-app-dir-i18next-example-ts
  2. npm run install
  3. npm run dev
  4. Put this url in your browser and hit enter: http://localhost:3000/de/client-page
image

Expected behavior

Should not output a hydration error.

Your Environment

  • runtime version: Node 18 but tested also with Node 16
  • i18next version: 23.0.1
  • os: Mac
adrai commented

try: c972072

Can confirm that fixes it.

Thanks a lot!!