Web app errors never reach Sentry

Report

The web app crashed for me on seedteamtalks.hyper.media (in a tab that had been open a long time, I clicked the Activity bell). Nothing showed up in Sentry. That's because Sentry isn't running in the production web app at all, on either the browser or the server side. Please wire it up so web crashes get reported.

Steps to reproduce

    Inspect the browser entry built by pnpm web:prod from clean main, and the Build Web App step in each release, development and custom image workflow. The old build supplies no Sentry DSN before that browser entry is compiled.

    Inspect the production stage of frontend/apps/web/Dockerfile and server initialization. The DSN build argument was available to a prior stage but absent from the production runtime stage.

    On the current PR, perform the same build and emitted-artifact check with a fake non-secret DSN, and again without a DSN; inspect runtime initialization using a test image and fake DSN. Do not use a real DSN for public proof.

Expected and actual

Expected: when an authorized deployment supplies a DSN, both the compiled browser entry and production server runtime initialize Sentry. A build without a DSN must still work and explicitly omit Sentry, so forks and self-hosted sites are not forced to use Seed's reporting.

Before, clean main 9a224eb3: a real no-DSN production web build exited 0, but its 4,329-byte browser entry lacked tracesSampleRate and ignoreErrors—initialization was compiled out. The baseline deployment test reported:

Ran 2 tests FAILED (failures=4) 3 Build Web App steps lacked build-time DSN; production runtime stage lacked DSN.

Those results show a deployment/instrumentation gap, not a reproduction of the specific Activity-bell crash or an observed missing Sentry receipt. Exact baseline commands and artifact hash.

Cause

Each web image workflow passed the DSN only to the Docker build, but PREBUILT=true skipped rebuilding the browser there: its entry had already been made by pnpm web:prod without the DSN. Supplying a fake DSN to that earlier step alone still left the entry unchanged, because the web build forced NODE_ENV=development and the client used it as a production guard. The production Docker stage also did not inherit the DSN for instrumentation.server.mjs. Changing only the browser or only the server therefore leaves a real gap.

Fix

The three workflows pass optional Sentry DSN, release and environment to the actual browser build. Client initialization and source-map guards use Vite production mode; a conditional checker inspects the emitted entry, requiring Sentry initialization when a DSN exists and its absence otherwise. The production image stage carries an overridable DSN and environment to server instrumentation. The older source-text Python test was removed because it broke valid no-DSN fork builds; the artifact itself is now checked.

After, exact PR head 706357a3: real production builds both with a fake DSN and with no DSN passed the conditional emitted-artifact check. Deliberately reversing the expected DSN presence failed both checks; a real test image initialized the server client with a fake DSN, accepted a runtime override, and omitted it when explicitly blanked:

Fake-DSN build: Sentry init markers present; verifier PASS. No-DSN build: Sentry init markers absent; verifier PASS (opt-out). Opposite verifier expectations: FAIL, as intended. Test image server: fake-DSN init PASS; override PASS; blank runtime DSN disables client.

This is a report of the recorded checks, not verbatim CI stdout; the exact-head build results and hash and real-image proof explain what was actually run. The enabled browser entry grows about 60.6 KiB gzipped; eager initialization can catch startup and hydration errors, and that tradeoff merits reviewer judgment. A self-hosted site must rebuild its browser entry to change the build-time DSN; runtime overrides affect the server only. No real event ingestion has been demonstrated.

PR and preview links

PR: https://github.com/seed-hypermedia/seed/pull/1450

No public preview: the change is build/image instrumentation rather than a safe browser-tryable interaction; a fake DSN cannot prove real ingestion, and a real DSN is not published in a preview. Verification record.

How to verify

Compare the before and after outputs above, inspect the three image workflows and emitted-entry verifier, and confirm the production Docker stage accepts an overridable runtime DSN. All nine CI checks succeeded on the exact PR head; Eric approved that head. After an actual merge and authorized development deployment, inspect the deployed browser entry and send a controlled dev test error to confirm a Sentry receipt. Do not claim the original Activity-click crash was fixed by this instrumentation. Review ignoreErrors: the current list still suppresses stale-tab chunk-load failures; recommend a separately reviewed privacy-safe, low-rate reporting change rather than silently changing the filtering here. No autonomous production deployment; no secret values in this task. Background: Claude Code session on yacht, 2026-11-24.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Connections0
Linked document · Outgoing linkLinked documentWeb app errors never reach SentryWeb app errors never reac…
Citations 0Children & links 1

Loading child documents…

Connections show where other documents or comments link to this document.

Related documents

Loading connections…