1 of 1 error Next.js (15.1.4) out of date (learn more) (Turbopack)
Console Error
Hydration failed because the server rendered HTML 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
if (typeof window !== 'undefined')
.Date.now()
or Math.random()
which changes each time it's called.It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
See more info here: https://nextjs.org/docs/messages/react-hydration-error
It looks like you're experiencing a hydration error in your Next.js application. The error message indicates that there's a mismatch between the server-rendered HTML and what React expects on the client side. The attributes data-new-gr-c-s-check-loaded="14.1231.0"
and data-gr-ext-installed=""
suggest this is likely caused by a browser extension (possibly Grammarly) that's modifying your HTML before React can hydrate it 1.
There are several approaches to resolve this:
suppressHydrationWarnings
to your HTML elementThe simplest approach is to add the suppressHydrationWarnings
attribute to your HTML element in your root layout. This tells React to ignore hydration mismatches for the entire document 1.
<html lang="en" suppressHydrationWarnings>
<body>{children}</body>
</html>
For more targeted suppression, use the SuppressHydrationWarning
component I've provided. This is useful for wrapping specific parts of your UI that might cause hydration issues.
For components that use dynamic data like dates or random values, render them only on the client side using the ClientOnly
component:
<ClientOnly>
<p>Current time: {new Date().toLocaleTimeString()}</p>
</ClientOnly>
While suppressing warnings works, it's better to fix the underlying issues:
ClientOnly
componenttypeof window !== 'undefined'
directly in your JSX.useEffect
hook to update it after mounting.next/dynamic
with ssr: false
for components that should only render on the client.React 19 (included in Next.js 15.1) has improved hydration error reporting with better diffs to help identify the exact mismatch 1.