New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Text content does not match server-rendered HTML. #1152
Comments
Hello, I encountered the same error. I fixed it by moving all components importing In your example, I think you need to create the |
I have the same error. |
I'm on using the App router and was having the same issue but setting my next.config.js like this fixes the issue. ` const config = nextTranslate(nextConfig) However doing this will affect the behaviour when trying to get the locale from request.nextUrl.locale in the middleware, now the locale is undefined. |
With this solution the react hydration mismatch error still exists in my case. |
Yes this is not going to work for the pages folder, this will just fix the 404 error are you getting the hydration error when you switch language? |
Hi 👋
What version of this package are you using?
I'm using version 2.6.0 of next-translate and next-translate-plugin.
What operating system, Node.js, and npm version?
My npm and node versions:
I'm using a macOS Ventura 13.4.1.
What happened?
I've been following the installation guide to add translations to my website. It loads well on the first render after the server started up. Then, whenever I refresh the page, I get an error
What did you expect to happen?
I'm expecting it to translate correctly my strings as it did for the initial render after server start.
Are you willing to submit a pull request to fix this bug?
I don't think I'd be able to submit a pull request as I don't even understand where it comes from. I read issues speaking about client components behaving a bit similarly but appeared to be fixed in 2.4 or something like that.
I also have a link to the versionned version of the beginning app. It is very minimalistic for now
The text was updated successfully, but these errors were encountered: