fix(changelog): resolve index-page hydration mismatch (Seer root-cause triage of open Sentry issues)#152
Open
rahulchhabria wants to merge 1 commit into
Open
Conversation
The changelog index awaited dynamic data at the page top level, so the search-param-driven client feed (ChangelogList, which reads URL state via nuqs/useSearchParams) was rendered outside any explicit Suspense boundary. Under `cacheComponents`, the statically prerendered tree then disagreed with the client resume, producing a hydration mismatch that surfaced in Sentry as "TypeError: Cannot read properties of null (reading 'parentNode')" (CHANGELOG-7X). Keep the header and document metadata in a static shell and stream the dynamic feed inside an explicit <Suspense> boundary. Extract the shared feed skeleton so loading.tsx and the Suspense fallback stay in sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjXWBRZkUCE3W9kXrcyYih
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Pulled all 17 open (unresolved) issues from the Sentry
changelogproject (orgsentry) and ran Seer root-cause analysis on each. This PR contains the one change that is a genuine, fixable application bug; the remaining issues are triaged directly in Sentry (see table) because their root causes are outside this codebase (bot/scanner traffic, third-party browser-injected scripts, a separate cloud function, deployment version skew, or infra/config).Code change — CHANGELOG-7X (hydration mismatch on
/changelog)Seer root cause: The index page awaited dynamic data at the page top level, so the search-param-driven client feed (
ChangelogList, which reads URL state vianuqs/useSearchParams) rendered outside any explicitSuspenseboundary. UndercacheComponents: true, the statically prerendered tree then disagreed with the client resume, surfacing asTypeError: Cannot read properties of null (reading 'parentNode')in React's streaming reconciliation.Fix: Keep the header + document metadata in a statically-prerenderable shell and stream the dynamic feed inside an explicit
<Suspense>boundary — the idiomatic Cache Components pattern.src/app/changelog/page.tsx— static shell +<Suspense>-wrapped<ChangelogFeed>src/app/changelog/feedSkeleton.tsx— extracted shared feed skeleton (new)src/app/changelog/loading.tsx— reuse the shared skeleton (DRY)Verification:
biome checkclean,tsc --noEmitclean (only the pre-existingsquiggle.pngimage-type note, unrelated),vitest run25/25 passing. Full hydration confirmation requires a production deploy (hydration can't be reproduced in unit tests).Not fixed here — framework-level (needs upstream Next.js)
CHANGELOG-1 / CHANGELOG-8B —
__next_metadata_boundary__resume mismatch on/changelog/[slug]. Seer attributes this to a Next.js 16.2.6 + Turbopack async-metadata-streaming interaction (100% of events on Turbopack). The[slug]route is alreadySuspense-wrapped vialoading.tsx, so there is no safe app-level structural fix — this should be tracked against a Next.js upgrade rather than patched speculatively. Left open in Sentry.Triaged in Sentry (not app-code bugs)
CONFIG/updateGapFiller— injected marketing-shell script, not in repowindow.__firefox__scriptNext-Router-State-Treeacross deploys (framework)_rscparam → FormData parsechangelog-twitter-postercloud fn)NEXTAUTH_SECRET(config)🤖 Generated with Claude Code
Generated by Claude Code