Skip to content

Report page crashes, recover from stale chunks, and survive page translation - #484

Open
eugenia-scandit wants to merge 1 commit into
mainfrom
feat/error-instrumentation
Open

eugenia-scandit wants to merge 1 commit into
mainfrom
feat/error-instrumentation

Conversation

@eugenia-scandit

@eugenia-scandit eugenia-scandit commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Crash reporting: errors caught by the error boundaries never reach window.onerror, so exception autocapture missed them. Both fallbacks now report the crash to PostHog, waiting up to 15 s for it to load and respecting an opt-out.
  • Stale chunks after a deploy: a first page load that asks for chunks a deploy removed fails before hydration, as an unhandled rejection, and leaves the page inert. It now reloads, at most once per page per tab in 10 minutes; a failure the guard blocks is reported. After the app has started, failed chunks (link preloads on hover) are left to Docusaurus.
  • Page translation: browser translation moves text nodes React owns, and React's next removeChild/insertBefore throws. A guard tolerates the moved node and logs a warning (the workaround from Make React resilient to DOM mutations from Google Translate react/react#11538). translate="no" on the copyable commands, the agent picker and both framework pickers.
  • capturePostHogEvent and the crash reporter share one helper (callPostHog) for the availability, opt-out and error rules.

…slation

- Errors caught by the error boundaries never reach window.onerror, so
  exception autocapture missed them. Both fallbacks now report the crash
  to PostHog, waiting up to 15 s for it to load and respecting an opt-out.
- A first page load that asks for chunks a deploy removed fails before
  hydration, as an unhandled rejection, and leaves the page inert. It now
  reloads, at most once per page per tab in 10 minutes; a failure the
  guard blocks is reported. After the app has started, failed chunks
  (link preloads on hover) are left to Docusaurus.
- Browser translation moves text nodes React owns, and React's next
  removeChild or insertBefore throws. A guard tolerates the moved node and
  logs a warning (the workaround from react/react#11538).
  translate="no" on the copyable commands, the agent picker and both
  framework pickers.
- capturePostHogEvent and the crash reporter share one helper for calling
  PostHog (callPostHog), so the availability, opt-out and error rules live
  in one place.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://Scandit.github.io/data-capture-documentation/pr-preview/pr-484/

Built to branch gh-pages at 2026-10-12 13:33 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
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.

1 participant