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 SDK are you using?
@sentry/nextjs
SDK Version
8.35.0
Framework Version
Next 14.2.11
Link to Sentry event
https://trusted-health.sentry.io/issues/5833907467/events/651aec0e738f4a8592762072abecec34/
Reproduction Example/SDK Setup
We've been having this issue for a while AFAIK, so here's what we've investigated
From the linked stack trace, these are the lines:
If (await tracedGetInitialProps.apply(thisArg, args))
results in undefined
we get a {}
default
But then all these:
const {
data: initialProps, // undefined
baggage, // undefined
sentryTrace, // undefined
} = {}
become undefined, so we're executing this:
// The Next.js serializer throws on undefined values so we need to guard for it (#12102)
if (sentryTrace) {
undefined._sentryTraceData = sentryTrace;
}
Which will result in those undefined access problems...
You guys also have some other places where there's similar code that might be worth checking
https://github.com/search?q=repo%3Agetsentry%2Fsentry-javascript+tracedGetInitialProps.apply%28thisArg%2C+args%29%29&type=code
It also seems sentry had a similar issue in the past
Steps to Reproduce
Don't know how to simulate
Expected Result
No throw
Actual Result
Throw
Metadata
Metadata
Assignees
Type
Projects
Status