Error message
Hydration failed in Next.js
The HTML rendered by the server doesn’t match what React renders in the browser for the same component. React drops the server’s HTML for that tree and renders it again on the client. In production the message becomes “Minified React error #418”, and its stack trace points into React, not into your component.
Examples run on 19 November 2026 with Next.js 16.4.6 (App Router, Turbopack), React 19.3.1, @sentry/nextjs 11.12.0 and Chromium 156. Errilo is in private beta.
What the message says
In development (next dev), React explains the mismatch and lists the usual causes. For a text that differs:
Hydration failed because the server rendered text didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.
It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.When the structure differs rather than a text, the message says the server rendered HTML didn't match the client. Next.js also prints the component tree down to the mismatch, with the client value prefixed by + and the server value by -:
<Page params={Promise} searchParams={Promise}>
<p>
+ hh0vwx
- fqgsehIn production (next build, next start), React’s messages are minified. The same error becomes:
Minified React error #418; visit https://react.dev/errors/418?args[]=text&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.The argument tells the two cases apart: args[]=text for a text that differs, args[]=HTML for a structure that differs. Next.js hands the error to window.reportError, so it reaches the page as an uncaught error. The page stays usable and shows what the client rendered.
Frequent causes
- A value that changes between the two renders:
Date,Math.random(), a date formatted in the user’s locale. The server and the browser each compute their own. - A static page rendered at build time. The server value is then that of the build. In our test, a component showing the time failed on every load in production, and never in
next dev: in development the page is rendered on each request, and both renders fall within the same second. - Invalid HTML nesting. A
<div>inside a<p>: the browser’s HTML parser rewrites the server’s HTML before React hydrates it. In development, React says so first:In HTML, <div> cannot be a descendant of <p>. This will cause a hydration error.In production, it is error #418 withargs[]=HTML. - React’s message also lists branches on
typeof window, data that changes without a snapshot sent with the HTML, and browser extensions that modify the page before React loads.
Minimal reproduction
'use client';
export function LastUpdated() {
// Computed twice: once on the server, once in the browser. The two values differ.
return <p>Last updated: {new Date().toLocaleTimeString('en-GB')}</p>;
}import { LastUpdated } from './last-updated';
export default function Page() {
return <LastUpdated />;
}Run next build then next start, and open /time: the page is prerendered at build time, and the browser throws Minified React error #418 with args[]=text on every load.
Fixes
Render browser-only values after mounting. The server and the first client render agree on a placeholder, then an effect fills in the real value. With this component, the error disappeared:
'use client';
import { useEffect, useState } from 'react';
export function LastUpdated() {
// Empty on the server and during hydration, filled in once the component is mounted.
const [time, setTime] = useState<string | null>(null);
useEffect(() => setTime(new Date().toLocaleTimeString('en-GB')), []);
return <p>Last updated: {time ?? '…'}</p>;
}Fix the nesting. Replace the <p> with a <div>, or the inner block with an inline element.
suppressHydrationWarning, with care. On the element whose text differs, it silences the error. But React then keeps the server’s text: in our test, the page went on showing the build time, on every load. Use it only when the server value is acceptable.
<p suppressHydrationWarning>Last updated: {new Date().toLocaleTimeString('en-GB')}</p>Finding the component in production
Source maps translate the frames of error #418, but they all land inside React. Here are the frames of our production event, translated with the build’s source maps (the React copied into Next.js 16.4.6), with the function each line belongs to:
react-dom-client.production.js:2970 throwOnHydrationMismatch
react-dom-client.production.js:8611 completeWork
react-dom-client.production.js:8893 completeWork
react-dom-client.production.js:12715 performUnitOfWork
react-dom-client.production.js:12710 workLoopConcurrentByScheduler
react-dom-client.production.js:12707 renderRootConcurrent
react-dom-client.production.js:13574 performWorkOnRootViaSchedulerTask
scheduler.production.js:151None of them is in your code. The component stack is missing too: React computes it, but Next.js only passes the error itself to window.reportError (its onRecoverableError, in Next.js 16.4.6). The source maps confirm it is a hydration mismatch (throwOnHydrationMismatch); the rest comes from the event:
- The kind of mismatch:
args[]=textorargs[]=HTMLin the message. - The page:
@sentry/nextjs11.12.0 adds a navigation breadcrumb with the route (from: "/time",to: "/time"in our test). - The component: open that route with
next dev, where Next.js prints the tree and the diff. If the mismatch only happens in production, as with a page rendered at build time, compare the HTML served bynext start(view the source) with the page once hydrated.
How Errilo shows it
The error arrives through the @sentry/nextjs browser SDK (see the Next.js guide), marked unhandled. The issue is titled Error: Minified React error #418; visit https://react.dev/errors/418?args[]=text…: the argument is in the title.
Errilo groups on the exception type and the frames. In our test, without source maps, a text mismatch and an HTML mismatch had different React frames and so formed two issues. The breadcrumbs of each event, shown on the issue page, contain the navigation to the page in question.