fix(observability): match minified React error format in PostHog filter (SHA-2377)#220
Merged
Merged
Conversation
…er (SHA-2377) SHA-2240 (commit 25b7d89) shipped suppressHydrationWarning at the DOM level + IGNORED_PATTERNS for unminified hydration error messages. But production builds minify React errors as "Minified React error #N; visit https://react.dev/errors/N..." — the form PostHog actually captures from production users. PostHog 14d audit (2026-05-08): docs continued to ingest ~125 React #418 hits across 84 distinct users after the SHA-2240 fix — all in the minified format that the existing patterns don't match. Two changes: 1. Add /Minified React error #(310|418|423|425)/ to IGNORED_PATTERNS so production-minified React errors are filtered alongside the un-minified dev-build versions. 2. Generalize the prism_bash_exports special-case to /prism_\w+_exports/ plus /Export 'prism_/ + /local binding for export 'prism_/. Same root cause (PrismJS-based browser extensions injecting into the page); the audit showed prism_python_exports also firing alongside prism_bash. Pure analytics-filter change; no runtime behavior modified. Underlying hydration suppression from SHA-2240 still in place at the DOM layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Completes SHA-2240 (
fix(hydration): suppress React #418 errors from Nextra internals). That commit shippedsuppressHydrationWarningon<body>+ i18n-prop removal + IGNORED_PATTERNS for unminified error messages — but production builds minify React errors as"Minified React error #N; visit https://react.dev/errors/N...", the form PostHog actually captures.PostHog 14d audit (2026-05-08): docs continued ingesting 125 React #418 hits across 84 distinct users after SHA-2240 — all in the minified format the existing patterns don't match.
Changes
components/PostHogProvider.tsx:Add
/Minified React error #(310|418|423|425)/so production-minified React errors are filtered alongside the un-minified dev-build versions.Generalize the
prism_bash_exportsspecial-case to/prism_\w+_exports/plus/Export 'prism_/+/local binding for export 'prism_/. Same root cause (PrismJS-based browser extensions injecting into the page); the audit showedprism_python_exportsalso firing alongsideprism_bash.Why this is safe
Pure analytics-filter change; no runtime behavior modified. SHA-2240's DOM-level
suppressHydrationWarningremains the actual hydration fix — this PR only stops the residual mismatch from inflating the PostHog metric.If a future hydration regression emerges that isn't covered by
suppressHydrationWarning, it'll still surface in dev (unminified) and via the underlying user funnel — only the production noise count is muted.Companion PR
sharpapi-site carries matching changes — https://github.com/Mlaz-code/sharpapi-site/pull/92.
Test plan
npm run typecheck)$exceptionrate drops to baseline of ~5–8/day on docs (currently ~15–36/day)Cross-references
🤖 Generated with Claude Code