Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Warning: Extra attributes from the server in the console

ErrorWarning: Extra attributes from the server: data-new-gr-c-s-check-loaded,data-gr-ext-installed

Short 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.

  • Applies to Next.js 15, React 19, Node.js 22
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 start
  2. 2Match what you see, then jump to its fix

    1. 1Warning 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. 2Only on the deployed site, in every browser, including a clean profileA CDN or edge service rewrites the HTMLFix
    3. 3Warning appears in a clean profile, on an element you renderYour own code renders different attributes on server and clientFix

What does the error look like?

  • Warning: Extra attributes from the server: data-new-gr-c-s-check-loaded,data-gr-ext-installed
  • Text 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 dev

Confirmed by nextjs.org

Did this fix it?

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 600

2Fix

Turn off the HTML-modifying feature for this site.

# In the CDN dashboard: disable HTML minification / Auto Minify for the zone

3Verify

Fetch the page again and confirm both responses match.

curl -s https://www.example.com/ | head -c 600

Confirmed by nextjs.org

Did this fix it?

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 components

2Fix

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 dev

Confirmed by react.dev

Did this fix it?

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:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.