You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app with static export and set everything up as described in the docs. Everything works fine, except that I now wanted to create a redirect from / to a default language.
The redirect does work fine, but since I added the page and layout in /app, I get an hydration error that states, that the lang attribute is broken. I was able to observe, that the /en page is delivered without the lang attribute even though it is set in the according layout. I recreated the issue in a repo based on the reproduction template, but I updated the packages.
Additional note: I also looked at the generated html files and the lang-attribute is also missing in the /en.html which will probably leads to the same problem in production (as far as I know. I am pretty new to the whole stack though).
Any insights and help is really appreciated.
Verifications
I've verified that the problem I'm experiencing isn't covered in the docs.
Awesome, this works. It's actually kind of obvious now that I see it, but as always, new libs are sometimes a bit overwhelming. Thanks for the quick response and solution 👍
Description
I have an app with static export and set everything up as described in the docs. Everything works fine, except that I now wanted to create a redirect from / to a default language.
I then followed the instructions here https://next-intl-docs.vercel.app/docs/routing/middleware#usage-without-middleware-static-export about locale detection without middleware. I created the page in the /app folder but in order to function I had to add a layout as well.
The redirect does work fine, but since I added the page and layout in /app, I get an hydration error that states, that the lang attribute is broken. I was able to observe, that the /en page is delivered without the lang attribute even though it is set in the according layout. I recreated the issue in a repo based on the reproduction template, but I updated the packages.
Additional note: I also looked at the generated html files and the lang-attribute is also missing in the /en.html which will probably leads to the same problem in production (as far as I know. I am pretty new to the whole stack though).
Any insights and help is really appreciated.
Verifications
Mandatory reproduction URL
https://github.com/rpetersen27/next-intl-static-export-hydration-bug
Reproduction description
Steps to reproduce:
Expected behaviour
The text was updated successfully, but these errors were encountered: