Skip to content

fix(core): Print getTraceMetaTags in 1 line to prevent hydration errors#22004

Merged
JPeer264 merged 1 commit into
developfrom
jp/trace-meta-tags-hydration
Jul 7, 2026
Merged

fix(core): Print getTraceMetaTags in 1 line to prevent hydration errors#22004
JPeer264 merged 1 commit into
developfrom
jp/trace-meta-tags-hydration

Conversation

@JPeer264

@JPeer264 JPeer264 commented Jul 7, 2026

Copy link
Copy Markdown
Member

closes #21915
closes JS-2897

It seems that new lines creating a React hydration error. By removing the newline it works again. IMO it wouldn't matter if there is a newline or not, as in Browsers the markdown is formatted anyways and in code this is anyways the used code. So I don't think there was a benefit of the newline anyways.

@JPeer264 JPeer264 requested a review from a team July 7, 2026 07:51
@JPeer264 JPeer264 self-assigned this Jul 7, 2026
@JPeer264 JPeer264 requested review from Lms24, logaretm and mydea and removed request for a team July 7, 2026 07:51
@JPeer264 JPeer264 requested a review from a team as a code owner July 7, 2026 07:51
@JPeer264 JPeer264 requested review from chargome and nicohrubec and removed request for a team July 7, 2026 07:51
@linear-code

linear-code Bot commented Jul 7, 2026

Copy link
Copy Markdown

JS-2897

@chargome chargome left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sane fix I think, just want to note that we have other places in the SDK (e.g. Astro) that still inject newlines around the metatags. But if that is just a React problem then this should suffice

@JPeer264 JPeer264 merged commit 7df7f30 into develop Jul 7, 2026
576 of 581 checks passed
@JPeer264 JPeer264 deleted the jp/trace-meta-tags-hydration branch July 7, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrapFetchWithSentry's injected trace meta tags break React 19 document hydration (error #418 on every SSR page)

3 participants