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 SDK are you using?
@sentry/browser
SDK Version
7.46.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
- pass in a custom context when capturing an exception, with its value as
undefined
Sentry.captureException(new Error('wat'), {
contexts: {
MyCustomContext: undefined
}
})
- look at the resulting issue in Sentry, a big red box appears at the top warning of an invalid value for a context
Expected Result
I would expect Sentry to either discard the context entirely (and omit the red error box) or fix the types declared in @sentry/types/types/context.d.ts
to match what is expected.
Actual Result
The result is a big error box in your Sentry UI when viewing an issue: