Skip to content

Conversation

@ryan953
Copy link
Member

@ryan953 ryan953 commented Aug 15, 2025

The original ticket was something like "Sentry raises attribute order or empty spaces in values as Hydration errors that have no effect on the HTML rendering"

I wrote a response on the ticket, but since this is a common enough thing I think it should be in the FAQ too. It's a good question that we've gotten before.

Fixes getsentry/sentry#97828

SCR-20250815-jnqv

@vercel
Copy link

vercel bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sentry-docs Ready Ready Preview Comment Aug 15, 2025 9:24pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
develop-docs Ignored Ignored Preview Aug 15, 2025 9:24pm

@codecov
Copy link

codecov bot commented Aug 15, 2025

Bundle Report

Changes will increase total bundle size by 3.52kB (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.9MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.46MB 3.52kB (0.03%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -5 bytes 1.78MB -0.0%
../instrumentation.js -1 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/[[...path]]/page.js.nft.json 1.18kB 755.97kB 0.16%
../app/platform-redirect/page.js.nft.json 1.18kB 755.89kB 0.16%
../app/sitemap.xml/route.js.nft.json 1.18kB 753.36kB 0.16%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/NSlne2XCD26av__w_Xwxo/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/NSlne2XCD26av__w_Xwxo/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/4c0I8B4ps3CoSS2m-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
static/4c0I8B4ps3CoSS2m-*.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️


![html diff tool](./img/hydration-diff-xmlns.png)

The class name `:hover` was added Session Replay when it serialized the page, React didn't see this class and it has no impact on hydration. This means the user was hovering and interacting with the page before react was finished hydrating (this is the whole point of hydration; to make the page react for interaction sooner!). By the time hydration was complete the user had moved their mouse so the :hover class is changed.
Copy link
Member

@michellewzhang michellewzhang Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The class name `:hover` was added Session Replay when it serialized the page, React didn't see this class and it has no impact on hydration. This means the user was hovering and interacting with the page before react was finished hydrating (this is the whole point of hydration; to make the page react for interaction sooner!). By the time hydration was complete the user had moved their mouse so the :hover class is changed.
The class name `:hover` was added by the Replay SDK when it serialized the page. React didn't see this class and it has no impact on hydration. This means the user was hovering and interacting with the page before React was finished hydrating (this is the whole point of hydration; to make the page react for interaction sooner!). By the time hydration was complete, the user had moved their mouse, so the `:hover` class is changed.

to? by?

Copy link
Member Author

@ryan953 ryan953 Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think by, in the sentence it's doing the thing.
added to the serialized json.. like 'added to the [serialzied] replay [data]'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could do 'by the replay sdk`

Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com>
@ryan953 ryan953 merged commit b2c61fb into master Aug 15, 2025
13 checks passed
@ryan953 ryan953 deleted the ryan953/97828-hydration-diffs branch August 15, 2025 22:26
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect hydration errors detected in Sentry

3 participants