Skip to content

Mismatch of type of Contexts between SDK and server #7933

Closed
@pfdzm

Description

@pfdzm

Is there an existing issue for this?

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

  1. pass in a custom context when capturing an exception, with its value as undefined
Sentry.captureException(new Error('wat'), {
  contexts: {
    MyCustomContext: undefined
  }
})
  1. look at the resulting issue in Sentry, a big red box appears at the top warning of an invalid value for a context
    image

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: image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: browserIssues related to the Sentry Browser SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions