Skip to content

refactor(web): adopt Sentry TanStack Start client-init pattern (#320)#380

Draft
tuliren wants to merge 1 commit into
elmohq:mainfrom
tuliren:issue-320-sentry-client-init
Draft

refactor(web): adopt Sentry TanStack Start client-init pattern (#320)#380
tuliren wants to merge 1 commit into
elmohq:mainfrom
tuliren:issue-320-sentry-client-init

Conversation

@tuliren

@tuliren tuliren commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopts the recommended Sentry TanStack Start client-init pattern so client errors thrown during early module evaluation (before hydration) are captured.

Changes

  • New apps/web/src/client.tsx that runs Sentry.init() before hydration. It mirrors TanStack Start's default client entry for our version (@tanstack/react-start@1.168.25) — defining this file overrides that default.
  • router.tsx now only attaches the router-aware browser-tracing integration via Sentry.addIntegration() (it needs the router instance, which doesn't exist at client-entry time).

Testing

  • tsc --noEmit passes and a full pnpm --filter @workspace/web build succeeds (the client-entry override is picked up).

Closes #320

🤖 Generated with Claude Code

…q#320)

Moves Sentry.init() out of getRouter() and into a new client entry
(src/client.tsx) that runs before hydration, so telemetry emitted during early
module evaluation is captured. The client entry mirrors TanStack Start's
default for our version (1.168.25) — defining it overrides that default — plus
the early init. router.tsx now only attaches the router-aware browser-tracing
integration via Sentry.addIntegration(). Verified with `pnpm --filter
@workspace/web build`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@tuliren is attempting to deploy a commit to the Blue Whale Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

Adopt new Sentry TanStack Start client-init pattern (move Sentry.init to client entry)

1 participant