I have a pretty complex site that uses i18n for both client side and server side rendered components and pages. I’m using NextJS 14.2.1 (React + typescript + tailwindcss) with the app folder structure with a [lng] folder in which all the pages are since I’m using language routing trough my URL (middleware). I get hydration warnings on my home page, probably because of the header and they don’t actually cause problems except for the error itself popping up.
I’ve tried to use suppressHydrationwarning and suppressHydrationWarning={true} but I still get the error. I checked if any of these are the reason (soruce):
Incorrect nesting of HTML tags
nested in another
tag
nested in a
tag
or nested in a
tag
Interactive Content cannot be nested ( nested in a tag, nested in a tag, etc.)
Using checks like typeof window !== ‘undefined’ in your rendering logic
Using browser-only APIs like window or localStorage in your rendering logic
Using time-dependent APIs such as the Date() constructor in your rendering logic
Browser extensions modifying the HTML
Incorrectly configured CSS-in-JS libraries
Ensure your code is following our official examples
Incorrectly configured Edge/CDN that attempts to modify the html response, such as Cloudflare Auto Minify
None of these problems are present.
So, is there a way to suppress these warnings globally? Or any other solution?
petar taneski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.