Skip to content

chore: Upload production source maps to Sentry - #15

Merged
do0ori merged 2 commits into
mainfrom
chore/sentry-symbolication
Sep 19, 2026
Merged

do0ori merged 2 commits into
mainfrom
chore/sentry-symbolication

Conversation

@do0ori

@do0ori do0ori commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Why

A RangeError: Maximum call stack size exceeded came in from production (issue 7738519042) with a fully minified stack — alternating Ok / Qk frames. Determining whether it was ours required diffing the reported line numbers against the deployed bundle by hand:

Sentry frame Reality
/visual-timer/:226:382 (Qk) index.html is 61 lines
/visual-timer/:226:63 (Ok) index-BJf-jupJ.js is 214 lines
/visual-timer/:190:70 bundle line 190 is 23 chars long

Every frame was attributed to the document URL, and index.html carries no inline script — so the recursion came from a script injected into the page (iOS Chrome extension / in-app injection) and was picked up by the global onerror handler. That should have taken seconds to establish, not a manual bundle diff.

What

  • Add @sentry/vite-plugin. Source maps are generated (hidden) only when SENTRY_AUTH_TOKEN is present, uploaded, then deleted from dist — so they are never published to GitHub Pages and local builds skip them entirely.
  • Pass SENTRY_AUTH_TOKEN to the build step; org and project are plain constants in vite.config.ts.
  • Set release on Sentry.init so uploaded maps match incoming events.
  • Tag events with own_code, derived from whether any located frame belongs to our hashed bundle under assets/. Events with no located frames default to true so nothing real is mislabelled.

Verification

  • npm run build passes; dist contains no .map files.
  • npm test — 32/32 passing.
  • End-to-end upload is only exercisable once this lands on main; the plugin is a no-op without the token, so a failure there cannot break the deploy.

Note

Unrelated to this crash, src/hooks/useTimer.ts:221 calls start(false) during render, which triggers setState and a fetch in the render phase. Worth a separate fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MUBfrDZLkPRPZQJxJWzeU4

do0ori and others added 2 commits September 19, 2026 14:51
Production stacks arrived minified, so a RangeError reported from an
injected third-party script was indistinguishable from our own code
without manually diffing line numbers against the deployed bundle.

Generate hidden source maps only when SENTRY_AUTH_TOKEN is present,
upload them, then strip them from dist so they never reach GitHub Pages.
Also tag events with own_code so injected-script noise stays separable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUBfrDZLkPRPZQJxJWzeU4
Only the auth token needs to stay secret, and requiring all three
environment variables meant the upload silently skipped in CI.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUBfrDZLkPRPZQJxJWzeU4
@do0ori
do0ori merged commit b1c5657 into main Sep 19, 2026
1 check passed
@do0ori
do0ori deleted the chore/sentry-symbolication branch September 19, 2026 05:56
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