-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
NextJS Sentry is using deprecated beforeNavigate
instead of beforeStartSpan
#11627
Comments
Hey, thanks for writing in! Hmm, this seems like a bug to me - we'll look into it! |
Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/7.111.0 - please upgrade and give it a try! |
Unfortunately it doesn't seem to work, @AbhiPrasad. Nothing gets logged. On a side note, before the fix I could make it work with: // @ts-expect-error: ignore TypeScript
beforeNavigate(options: { name: string }) {
...
} That actually produced some console logs and in Chrome network view I could see that the transaction name got updated. Now, it seems that it doesn't work at all. |
I will look into it, it seems that something is really off there, sorry about that! |
…on` (#11765) Turns out the logic to get the options was not correct, because we used the `options` that the integration exposes, but this has `instrumentPageload: false` & `instrumentNavigation: false` because we did not "fix" the `options` we expose on the integration. This was not caught by the tests, because it only happens if passing the `browserTracingIntegration` from `@sentry/nextjs` or `@sentry/sveltekit`, not when passing the "original" one (which we had tests for). Really fixes #11627
So we've just released v7.112.2, where we hopefully actually have a full fix for your problem - sorry about the confusion! |
From what I can see, Also, in the big "envelope/..." request I can see that the |
This seems to be fixed, so I am closing this 👍 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.110.0
Framework Version
13.2.4
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
Used configuration from above in
sentry.client.config.ts
by following the documentation.Expected Result
Function
beforeStartSpan
should be called and a log should appear in console when it's called.Actual Result
Function
beforeStartSpan
is never called. I suspect it's caused by the weirdfixBrowserTracingIntegration
method that converts the most recent browser tracing integration to the deprecated one.What's more, using
beforeNavigate
actually works, but produces TypeScript errors since it's not defined inBrowserTracingOptions
.This is contrary to what the documentation says.
The text was updated successfully, but these errors were encountered: