Repository navigation
Epic Stack catch-up 2/7: Sentry hidden maps + event filters #25
Description
Parent issue: #23
Parent: search for issue titled “Epic Stack catch-up: tracking”. Depends on package 1/7 being merged to dev (or confirm it is not required; this package does not need the RR CVE bump to compile).
Goal
Fix Sentry client source maps and drop expected healthcheck/bot noise. This site already installed Sentry (p/pat-22-sentry). Do not bump Sentry 9 → 10 here (that is package 6).
Why
- Broken client maps —
vite.config.tsstill passessourcemapsthroughunstable_sentryVitePluginOptions. That overwrites@sentry/react-router’ssourcemaps.disable: true, double-stamps debug IDs, and Sentry symbolicates the map-less ID. Upstream: epicweb-dev/epic-stack@f64d690 / fix: stop Sentry double debug IDs breaking client source maps epicweb-dev/epic-stack#1095 - Noise — bots hitting routes without loaders/actions, and healthcheck Prisma spans, clutter Sentry. Upstream: epicweb-dev/epic-stack@f1da831 / fix: filter Epic Stack Sentry healthcheck and bot noise epicweb-dev/epic-stack#1093
This site’s healthcheck already uses prisma.$queryRaw\SELECT 1`` and already skipped the self-HEAD. Do not reintroduce the self-HEAD.
Do this
Branch off origin/dev. PR into dev.
A. Vite / Sentry build config (from epic-stack vite.config.ts)
In vite.config.ts:
- Set
build.sourcemapto'hidden'(maps for Sentry upload, nosourceMappingURLin public assets) - Keep
releaseon the top-levelSentryReactRouterBuildOptions(name: process.env.COMMIT_SHA,setCommits.auto) - Remove
unstable_sentryVitePluginOptionsentirely (do not passsourcemapsthrough it) - Keep this site’s localtunnel
server.allowedHostslogic (LOCAL_TUNNEL_SUBDOMAIN/LOCAL_TUNNEL_DOMAIN) - Do not add
react-router-devtoolsor the vitest cache-server stub plugin (later packages)
Reference implementation: https://github.com/epicweb-dev/epic-stack/blob/main/vite.config.ts (copy only the sourcemap + sentryConfig parts)
B. Event filters (from epic-stack)
Add these files from upstream (adapt import paths to this repo’s routes+ layout):
app/utils/sentry-event-filters.tsapp/utils/sentry-event-filters.test.ts
Wire shouldDropErrorEvent / isExpectedReactRouterErrorMessage / isHealthcheckTransaction into:
server/utils/monitoring.ts—ignoreErrorsfor missing action/loader/method;beforeSend+beforeSendTransactionusing the helpers. Upstream also switchedPrismaInstrumentationto a named import from@prisma/instrumentation; do that if it typechecks on Sentry 9. If it does not, keep the existingprismaInstrumentationdefault-import workaround and still add the filters.app/entry.server.tsx— useisExpectedReactRouterErrorMessagethe same way upstream does inhandleError(read currententry.server.tsxand epic-stack’s before editing)
Do not change app/routes/resources+/healthcheck.tsx except if types require a tiny fix. Keep SELECT 1. Do not add the fetch self-HEAD.
Files allowed
vite.config.tsapp/utils/sentry-event-filters.ts(new)app/utils/sentry-event-filters.test.ts(new)server/utils/monitoring.tsapp/entry.server.tsxapp/utils/monitoring.client.tsxonly if needed to match filter behavior on the client (prefer not)
Do not
- Do not bump
@sentry/react-routeror@sentry/profiling-nodeto v10 - Do not remove localtunnel
allowedHosts - Do not add
reactRouterDevTools()or changeapp/routes.ts - Do not edit dashboard,
fly.toml, or Dockerfile - Do not start other catch-up packages
Acceptance
sentryConfighas top-levelreleaseand nounstable_sentryVitePluginOptionsbuild.sourcemap === 'hidden'- Filter helpers exist and have unit tests that pass
npm run typecheckandnpm run test -- --runpass- Localtunnel config still present
- PR targets
dev
Staging smoke (human)
- Load staging, confirm app boots
- After a deploy with
SENTRY_AUTH_TOKENset, a test client error should map to TS/TSX, not a second debug ID - Healthcheck traffic should not flood new Sentry issues
PR target: dev (never main). Implement only this issue.
Activity
goodeats commentedon Aug 25, 2026
#24 / PR #31 is on
dev, but wait for #33 (PR #37) before starting this package. Staging deploys are still blocked until Playwright collection/install is reliable.goodeats commentedon Aug 25, 2026
#24 and #33 are both on
dev. Next after staging smoke of that deploy (not before).