Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.19
Framework Version
Nextjs 12
Link to Sentry event
Steps to Reproduce
We never used Sentry SDK on version 5.12 but for some reason Sentry still reports it under the wrong version.
Could this be related to the app being deployed in Vercel? Is it some kind of npm package caching issue?
Expected Result
Error to be reported on the expected SDK version.
Actual Result
Metadata
Metadata
Assignees
Labels
No labels

Activity
Lms24 commentedon Nov 15, 2022
Hi @gabrielsch thanks for writing in! This seems a little strange but let's try to find what might be causing this!
First, let's do a sanity check: You said that you can't recall ever having used the 5.12.1 version. Would you nevertheless mind checking your
package-lock.json/yarn.lockor deleting and re-installing yournode_modules? I'm not sure if there's some sort of version mismatch but weird behaviour like this happens quite often because of some weird dependency issues.One thing I find interesting is that when looking at your event, I find an error message on the top:
We don't store SDK info in this variable but it might be worth investigating this a little more. Hence a few questions: Are you making modifications to the events (e.g. in
beforeSend,beforeSendTransactionor custom event processors)? Do you set special init options (e.g. custom integrations, or perhaps you're setting_metadata?).Are you perhaps initializing Sentry manually (i.e. create a hub and client yourself instead via Sentry.init)?
gabrielsch commentedon Nov 15, 2022
@Lms24 just checked the lockfile and we are definitely installing the latest one (7.19)
We do customize the event fingerprint and tags eventually, let me share the code with you:
We have a package wrapping some sentry config defaults, which uses @sentry/nextjs under the hoods.
The next.js app itself uses this wrapper package to initialize sentry on
sentry.client.config.tsandsentry.server.config.tsLms24 commentedon Nov 16, 2022
Interesting. On first glance I can't find anything that would mutate the SDK's metadata object. For a little more context, our SDK holds its info in the client options (which are based on the options passed to
Sentry.init).The warning in the event suggests to me that something in the SDK's event processing pipeline might not work as intended.
Let's check which version the SDK sets locally to its events. I'd suggest using this code:
Insert it once after the
Sentry.initcall and inbeforeSend. It'd be interesting to find out if the SDK has the wrong data from the beginning onwards or if there's anything happening to the client options which causes this.lobsterkatie commentedon Nov 17, 2022
A few thoughts here:
sdkProcessingMetadatais making its way to Sentry, as we make a point to delete it before events go out the door. I suspect the version mismatch is to blame here, too, though. If a newer version of one package is adding it, but the code which is doing the sending is from an older version, then it wouldn't get deleted.Side note: This is a place where this would come in really handy.
gabrielsch commentedon Nov 17, 2022
@lobsterkatie @Lms24
Hi folks, after spending some more time into this, I realized that the sentry.client wasn't enabled in our app due to a missing env var / config.
After fixing it, issues started being reported in the expected version, however something weird was going on since we were receiving issues from the wrong version even with the client being disabled.
Thank you and sorry for making you spending time on this 😄
Lms24 commentedon Nov 17, 2022
Great to hear that this is resolved 😄
I'm gonna close this issue but feel free to tag us in case more needs to be done here.