Skip to content

sentry client initialization should be in client entry point #21088

@valerii15298

Description

@valerii15298

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/tanstackstart-react

SDK Version

10.53.1

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

The current sentry docs for tanstack-start setup(https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/manual-setup/#configure) recommend for client side initializing sentry in router.ts file, specifically in getRouter function by checking !router.isServer. But that is wrong, since sentry should be initialized before any other code starts executing.

The correct place to initialize sentry on client side is client entry point: https://tanstack.com/start/latest/docs/framework/react/guide/client-entry-point#client-entry-point

In src/client.tsx file

Steps to Reproduce

  1. Go to https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/manual-setup/#configure-client-side-sentry

  2. Look at the page

Expected Result

Sentry docs should recommend using tanstack-start client entry point for client side setup.

Actual Result

Docs recommend using router.ts for client initialization which loses lots of useful events/errors until sentry is initialized

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions