fix(web): suppress hydration warning on <body>#248
Merged
Conversation
Browser extensions (e.g. YouMind, Grammarly, ColorZilla) inject attributes onto <body> before React hydrates, producing a "server rendered HTML didn't match client" console error in dev. `<html>` already had suppressHydrationWarning; mirror it on `<body>` so any extension that targets the body element no longer surfaces a false-positive hydration mismatch to end users. Closes #243
lefarcen
commented
May 2, 2026
Contributor
Author
lefarcen
left a comment
There was a problem hiding this comment.
LGTM π
Clean minimal fix that mirrors the existing suppressHydrationWarning on <html>. Verified:
- β
No server-side
<body>attribute mutations in codebase (alldocument.bodyusage is client-side-only) - β
Prop name correct (
suppressHydrationWarningper React 18 API) - β Matches Next.js official recommendation for extension-induced hydration mismatches
P3 nits (non-blocking):
- Test plan checkboxes unchecked β unclear if actually tested with YouMind/Grammarly
- Future-proofing: if we ever add
<body className={...}>in SSR, a real mismatch would be silently suppressed. (Unlikely given current arch, but worth noting for future readers.)
Ready to ship. π’
Siri-Ray
approved these changes
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Browser extensions like YouMind, Grammarly, and ColorZilla inject attributes onto
<body>before React hydrates, producing a "server rendered HTML didn't match client" console error in development.<html>already hadsuppressHydrationWarning; mirror it on<body>so any extension that mutates the body element no longer surfaces a false-positive hydration mismatch to end users.Repro (from #243)
User had the YouMind extension installed, which injects
youmind-sidebar-openandyoumind-extension-versiononto<body>. Next.js dev mode then logged:Adding
suppressHydrationWarningon<body>is the official Next.js-recommended fix for extension-induced mismatches (docs).Test plan
pnpm -C apps/web devwith YouMind (or any extension that mutates body) installed β verify no hydration error in consoleCloses #243