Warning: Extra attributes from the server in the console
Warning: Extra attributes from the server: data-new-gr-c-s-check-loaded,data-gr-ext-installedShort answer
React found attributes on an element in the server HTML that its own render did not produce. Browser extensions that edit the page are a documented cause, as are CDNs that rewrite HTML. Test in a private window without extensions. If the warning goes away, add suppressHydrationWarning to the element.
Fix it fast
1Find out which cause you have
Open the site in a private window with extensions disabled, or in another browser profile. If the warning is gone, an extension is adding the attributes.
npm run build && npm run start2Match what you see, then jump to its fix
- 1
Warning names attributes such as data-*-ext-installed on <body> or <html>; absent in a clean profileA browser extension modifies the HTML before React hydratesFix - 2
Only on the deployed site, in every browser, including a clean profileA CDN or edge service rewrites the HTMLFix - 3
Warning appears in a clean profile, on an element you renderYour own code renders different attributes on server and clientFix
- 1
What does the error look like?
Warning: Extra attributes from the server: data-new-gr-c-s-check-loaded,data-gr-ext-installedText content does not match server-rendered HTML
Cause 1 of 3
A browser extension modifies the HTML before React hydrates
1Check
Disable extensions one by one, or compare the page in a clean profile.
# In the browser console on the page:
document.body.getAttributeNames()2Fix
Your own code is fine, so silence the warning on the element the extension changes. It only works one level deep, so put it directly on <body> or <html>.
// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body suppressHydrationWarning>{children}</body>
</html>
)
}3Verify
Reload with the extension on. The warning should no longer appear.
npm run devConfirmed by nextjs.org
Cause 2 of 3
A CDN or edge service rewrites the HTML
1Check
Compare the raw HTML from the origin with what the CDN returns. Features such as Cloudflare Auto Minify change the markup.
curl -s https://origin.example.com/ | head -c 600
curl -s https://www.example.com/ | head -c 6002Fix
Turn off the HTML-modifying feature for this site.
# In the CDN dashboard: disable HTML minification / Auto Minify for the zone3Verify
Fetch the page again and confirm both responses match.
curl -s https://www.example.com/ | head -c 600Confirmed by nextjs.org
Cause 3 of 3
Your own code renders different attributes on server and client
1Check
Look for window, localStorage or Date used while rendering. The first client render must match the server.
grep -rn "typeof window\|localStorage\|new Date()" app components2Fix
Render the same thing first, then switch after mount.
'use client'
import { useState, useEffect } from 'react'
export default function Banner() {
const [isClient, setIsClient] = useState(false)
useEffect(() => setIsClient(true), [])
return <p>{isClient ? 'Client only text' : 'Server text'}</p>
}3Verify
Reload in a private window; the console stays clean.
npm run devConfirmed by react.dev
How do I stop it coming back?
- Test hydration in a clean browser profile before assuming your code is wrong.
- Keep suppressHydrationWarning for unavoidable differences only; it hides real bugs on that element.
- Do not branch rendering on typeof window.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
Related fixes
Web apps
React hydration failed: the server HTML and the first browser render differ
Text content does not match server-rendered HTML
Hydration fails when the first render in the browser produces different HTML from the HTML the server sent.
5 causes, each with a fixWeb apps
Upgrading to Next.js 16: middleware becomes proxy, and the other things that break
Missing Required default.js for Parallel Route
Next.js 16 renames middleware.ts to proxy.ts and its exported function to proxy.
6 causes, each with a fixWeb apps
Next.js stops with 'document is not defined' while it renders on the server
ReferenceError: document is not defined
Next.js renders your components on the server first, where there is no document.
3 causes, each with a fixWeb apps
A custom error from the server arrives at the client as a generic message
error.digest holds a hash instead of your message
Next.js hides the message of errors thrown in Server Components in production, to avoid leaking details.
3 causes, each with a fixWeb apps
useState fails in a child component in the Next.js App Router
React client hook in Server Component
In the App Router every component is a Server Component unless a file above it is marked otherwise, and Server Components cannot use state or effects.
3 causes, each with a fixWeb apps
React warns about updating one component while another renders
To locate the bad setState() call inside `Child`, follow the stack trace
React renders must be pure.
4 causes, each with a fix