Gerris home
Gerris

Chris Abraham: technical consulting, AI tools, and technical SEO

Home › Guides › Hydration Errors

React hydration errors and what they mean for SEO

If your browser console on a React or Next.js site shows "Minified React error #418," the page has a hydration error. It rarely stops Google from indexing the content, so it's easy to leave alone. It still costs you layout stability, responsiveness, and trustworthy analytics, and it usually points at a markup fault worth fixing at the source.

What hydration is

A server rendered React page arrives as finished HTML, so visitors and crawlers see content immediately. Then React loads in the browser and "attaches" itself to that HTML, wiring up buttons, menus, and forms. React calls this hydration: it turns the server's HTML snapshot into an interactive app.

For that to work, the HTML React expects to find has to match what the server sent. React's documentation says it expects the rendered content to be identical, and that you should treat mismatches as bugs and fix them.

What error #418 means

Production builds of React strip long error messages to save bytes and print a number instead. React's error page decodes #418 as: hydration failed because the server rendered HTML didn't match the client, and as a result the tree will be regenerated on the client. In plain terms, React gave up on the server's HTML for that part of the page and built it again in the browser.

What it means for search

Google crawls the server's response first, and server rendering means the content is already in that HTML. Google's JavaScript SEO documentation still recommends server side or pre-rendering for exactly that reason: it's faster for users and crawlers, and not every bot runs JavaScript. A hydration error happens after that HTML is delivered, so the words on the page usually still reach the index.

The costs show up elsewhere:

Head tags are a separate concern. In Next.js, metadata set with generateMetadata or a metadata export is resolved on the server and sent as HTML, so titles and canonicals don't depend on hydration succeeding.

The usual causes

React's own list covers most of what I find on real sites:

Finding them across a whole site

The browser console shows you one page at a time, and hydration errors often live on a handful of templates or on pages whose CMS content happens to contain bad markup. Spot checking misses them. I script headless Chrome with Playwright to load every URL in the sitemap or the crawl, collect each console error with the URL it came from, and group the results by template. A few hundred pages run in minutes.

The production build tells you only that a mismatch happened. To see where, run the same page against a development build, where React warns about each mismatch with its full message instead of a number. Once the list is grouped, the cause for each template is usually obvious within a few minutes of reading.

Fixing them at the source

Then stop the problem coming back. A small check in the build that parses every rendered page and fails on unbalanced tags or invalid nesting catches the CMS content that would have caused the next one.

References