On 26 November 2026 PostHog added an experimental handler to its Node SDK that sends React Router server errors to Error Tracking. Each error arrives with page, request, session and person context, and it respects the visitor’s capture consent.
If your web app or companion site runs on React Router, this matters. Server-side failures in loaders and actions never reach the browser console. Users see a blank page or an error screen, and you see nothing.
Why This Metric Matters
Browser error tracking only catches what happens on the device. A failing loader, a database timeout or a bad API response happens on your server, and the visitor just leaves.
Without server error data, you cannot tell a quiet day from a broken checkout. Support tickets become your monitoring, and by then the damage is done.
Data Points to Track
Check that each server error carries these properties:
$exception_typeand$exception_messageroute_idorroute_pathwhere the error happenedhandler_kind(loader, action or render)http_statusreturned to the visitorrequest_methodand a sanitisedrequest_url$session_idanddistinct_idwhen the visitor consentedconsent_state(granted or declined) at capture timerelease_versionof the deployed builderror_rate_per_routeper hour
Setup Steps
- Update the PostHog Node SDK to the version that includes the React Router handler. It is experimental, so pin the version.
- Add the handler to your server entry file, following the PostHog docs.
- Pass the visitor’s session and distinct ID from the request so errors link to people and replays.
- Connect your consent logic. Confirm no person data is sent when consent is declined.
- Strip query strings and form values that may hold personal data before capture.
- Trigger a test error in a loader and confirm it appears in Error Tracking with the right route.
- Create an alert for any route whose error rate rises above its normal level.
Actionable Insights
One route produces most errors. Fix that route first. It is usually a single bad query or a missing null check.
Errors cluster after a release. Compare release_version values. A spike right after a deploy points to a regression you can roll back.
Errors come only from signed-in users. The problem is likely in how you read session or account data.
Errors with no session ID. Either the visitor declined consent, or your handler is not passing the session through. Check which before you trust the totals.
Common Mistakes to Avoid
Do not treat an experimental handler as a full monitoring system. Keep your existing logs and uptime checks. Do not log request bodies, since they often hold emails or payment details. And remember that consent-aware capture means some errors will have no person attached, so count error volume by route as well as by user.