Skip to content

react-router v7 SDK doesn't re-export from @sentry/react and is missing withProfiler #16459

Closed
@derekr

Description

@derekr

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react-router

SDK Version

^9.24.0

Framework Version

react 19.0.0 react-router "7.0.0"

Link to Sentry event

No response

Reproduction Example/SDK Setup

Sentry.init({
	dsn: SENTRY_DSN,
	environment: getPublicEnvValue('APP_ENV') ?? 'production',
	release: getPublicEnvValue('RELEASE_VERSION'),
	tracesSampler: ({ name, parentSampled }) => {
		if (getPublicEnvValue('APP_ENV') === 'development' && SENTRY_SPOTLIGHT) {
			return 1;
		}
		// Skip trace sampling for non-production environments
		if (getPublicEnvValue('APP_ENV') !== 'production') return false;

		if (name.startsWith('navigation')) {
			return 1;
		}

		if (typeof parentSampled === 'boolean') {
			return parentSampled;
		}

		return 0.25;
	},
	profilesSampleRate: 1, // relative to traces sample rate
	replaysSessionSampleRate: 0,
	replaysOnErrorSampleRate: 0,
	tracePropagationTargets: ['localhost', /^https:\/\/charts\.basedash\.com\//],
	integrations: [
		Sentry.reactRouterTracingIntegration(),
		/**
		 * https://docs.sentry.io/platforms/javascript/guides/remix/configuration/integrations/extraerrordata
		 */
		Sentry.extraErrorDataIntegration(),
		Sentry.browserTracingIntegration(),
		Sentry.browserProfilingIntegration(),
		Sentry.replayIntegration({
			// Additional SDK configuration goes in here, for example:
			maskAllText: true,
			blockAllMedia: true,
		}),
	],
});

Steps to Reproduce

  1. Setup Sentry per documentation for react-router v7 framework mode
  2. Try to wrap app component (or any component with Sentry.withProfiler

Maybe related, but the reactComponentAnnotation feature is not working either #16471

Expected Result

I can wrap my component(s) with withProfiler and receive react spans.

Actual Result

I can't wrap my component with withProfiler.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions