Skip to content

reactRouterTracingIntegration() is not a function #16363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
gu-stav opened this issue May 22, 2025 · 3 comments · May be fixed by getsentry/sentry-docs#13817
Open
3 tasks done

reactRouterTracingIntegration() is not a function #16363

gu-stav opened this issue May 22, 2025 · 3 comments · May be fixed by getsentry/sentry-docs#13817

Comments

@gu-stav
Copy link

gu-stav commented May 22, 2025

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.22.0

Framework Version

7

Link to Sentry event

No response

Reproduction Example/SDK Setup

To setup tracing with react-router@7 the docs suggest to use https://docs.sentry.io/platforms/javascript/guides/react-router/tracing/ server-side (and browserTracingIntegration() client-side).

import * as Sentry from "@sentry/react-router";

Sentry.init({
  integrations: [Sentry.reactRouterTracingIntegration()],
});

I can see types being exported, but no function:

__vite_ssr_import_0__.reactRouterTracingIntegration is not a function

Steps to Reproduce

  1. Setup react-router with vite@7
  2. Setup tracing according to the documentation
  3. See function not being exported

Expected Result

I expect to be able to call Sentry.reactRouterTracingIntegration() or an equivalent.

Actual Result

The function can not be called, because it is not exported.

@chargome
Copy link
Member

Hey @gu-stav thanks for reaching out!

So the page you are referring to is talking about client-side tracing, not the server.

To summarize how to set up tracing in react-router:

  • In your client init call you need to add integrations: [Sentry.reactRouterTracingIntegration()] and set a tracesSampleRate
  • In your server init call you just need to set a tracesSampleRate

I'll update the docs page to make this more clear, sorry for the confusion here!

@gu-stav
Copy link
Author

gu-stav commented May 23, 2025

@chargome Got, it thank you! Sorry for the confusion, but getting tracing setup was a very frustrating story for us.

In case you need input on the docs, feel free to ping me anytime. Thank you!

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 23, 2025
@chargome
Copy link
Member

but getting tracing setup was a very frustrating story for us

I'm sorry this was the case! Were there any other hiccups than the confusion between client/server setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants