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.

Updated

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
-   fqgseh

In 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

Minimal reproduction

app/time/last-updated.tsx
'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>;
}
app/time/page.tsx
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:

app/time/last-updated.tsx
'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.

app/time/last-updated.tsx (excerpt)
<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:151

None 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:

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.

Early access

The private beta is open, by invitation, to a handful of teams running a JavaScript, TypeScript, PHP or Python app in production. Join the waitlist and we’ll write to invite you.