fix: resolve Sentry hydration mismatch and suppress extension noise#439
fix: resolve Sentry hydration mismatch and suppress extension noise#439ajitpratap0 merged 2 commits intomainfrom
Conversation
FadeIn.tsx — fix SSR hydration mismatch (Sentry #104333516, #104333514):
Framer Motion applies initial={{ opacity:0, y:16 }} before React hydrates,
causing the server-rendered DOM (opacity:1) to mismatch the client DOM.
Fix: render a plain <div> on server + during hydration (isMounted=false),
then swap to <motion.div> after useEffect fires. No mismatch, no flash.
instrumentation-client.ts — filter browser extension noise (Sentry #106232192, #105431404):
Add beforeSend hook to drop two known extension-only error patterns:
- "Cannot assign to read only property 'pushState'" — extensions wrap
history.pushState before the app loads, making it read-only
- "Object Not Found Matching Id:N, MethodName:update" — Chrome DevTools
Protocol messages from extensions interacting with CodeMirror
GitHub issue #435 (Object Not Found) closed as noise.
Issues #436/#437 (hydration) resolved by the FadeIn fix.
Issue #434 (pushState) silenced via beforeSend filter.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task —— View job Code Review for PR #439Todo List
Review SummaryThis is a well-executed fix that addresses real hydration issues while appropriately filtering browser extension noise. The solutions are technically sound and follow React SSR best practices. Code Quality & Best Practices ✅FadeIn.tsx (
|
- Wrap FadeIn in memo() to prevent unnecessary re-renders from parent state changes that don't affect the component's own props - Log suppressed extension noise errors to console.debug in development so they remain visible locally while staying off Sentry in production Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @ajitpratap0's task —— View job Code Review for PR #439Todo List
Review SummaryThis is a well-executed fix that addresses real hydration issues while appropriately filtering browser extension noise. The solutions are technically sound and follow React SSR best practices. Code Quality & Best Practices ✅FadeIn.tsx (
|
Summary
Fixes all 4 open Sentry issues from #434–#437.
Real bug fix —
FadeIn.tsxhydration mismatch (closes #436, #437)Root cause: Framer Motion applies
initial={{ opacity: 0, y: 16 }}via a layout effect before React hydrates. The server renders content atopacity: 1(theanimatestate), but the client DOM gets set toopacity: 0by Framer Motion before React checks for mismatches → hydration error in 8 events across 2 users.Fix: Render a plain
<div>on server + during the hydration pass (isMounted = false). AfteruseEffectfires (post-hydration), swap to<motion.div>with the standard animation. No mismatch, no flash, animations preserved.Noise suppression —
beforeSendfilter (silences #434, closes #435)Added two
beforeSendfilters ininstrumentation-client.tsfor known browser-extension-only error patterns that cannot be fixed in app code:Cannot assign to read only property 'pushState'history.pushStatebefore app loadsObject Not Found Matching Id:N, MethodName:updateBoth patterns are well-documented browser extension artifacts. Neither is reproducible without the extension, neither has recurred since initial detection.
Issues resolved
beforeSendfilterFadeIn.tsxTest plan
🤖 Generated with Claude Code