Skip to content

Stop reporting React Router method errors to Sentry - #96

Merged
kody-bot merged 1 commit into
mainfrom
cursor/sentry-g1-gratitext-c06b
Jul 24, 2026
Merged

kody-bot merged 1 commit into
mainfrom
cursor/sentry-g1-gratitext-c06b

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jul 24, 2026

Copy link
Copy Markdown
Member

Fixes the three open getInternalRouterError Sentry issues in gratitext (GRATITEXT-J / M / K). Event inspection showed they are not one app bug: scanners POSTing GraphQL probe paths, OPTIONS preflights, and GETs to the action-only theme-switch resource. Server handleError was capturing those RouteErrorResponses even though the client GeneralErrorBoundary already ignores them.

Changes

  • Skip RouteErrorResponse in handleError via shouldReportToSentry
  • Narrow beforeSend filter for React Router method-noise messages (defense in depth)
  • Splat route action returns 404 (same as loader) for probe POSTs
  • Theme-switch loader redirects home for bare GETs
  • Unit tests for the reporting helpers

Sentry outcomes

  • GRATITEXT-J (7242579523) — fixed → resolved
  • GRATITEXT-M (7281219877) — fixed → resolved
  • GRATITEXT-K (7251829085) — fixed → resolved

Status

Test Plan

  • bun test (includes new error-reporting.server.test.ts)
  • bun run lint
  • bun run typecheck
  • CI green on this PR
  • Deploy green on main

Checklist

  • Tests updated
  • Docs updated

Screenshots

N/A (server-side Sentry reporting / route method handling)

Open in Web Open in Cursor 

Server handleError was capturing RouteErrorResponses for bot OPTIONS,
GraphQL probe POSTs, and GETs to action-only resource routes. Skip those
(matching the client ErrorBoundary), add a beforeSend safety net, and
give splat/theme-switch handlers for the common probe paths.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kody-bot
kody-bot marked this pull request as ready for review July 24, 2026 20:02
@kody-bot
kody-bot merged commit 519b8e9 into main Jul 24, 2026
6 checks passed
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.

3 participants