Skip to content

Can't do away with deprecated warning for showReportDialog() #10277

@pcnova

Description

@pcnova

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.94.1

Framework Version

17.0.2

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: '[OMMITTED]',
  environment: process.env.NODE_ENV,
  autoSessionTracking: false,
  beforeSend(event) {
    if (process.env.NODE_ENV === 'production') {
      // Determine if our error handler dealt with this
      const handled =
        event.contexts && event.contexts[sentryErrorHandledProperty];

      if (!handled) {
        const opts: NewReportDialogOptions = { eventId: event.event_id };
        Sentry.showReportDialog(opts);
      }
      return event;
    }
    return null;
  },
});

Steps to Reproduce

  1. Try to use the Sentry.showReportDialog() anywhere, passing the newly-recommended {eventId: string} options object.
  2. See that the deprecated warning does not go away.
  3. If you try to enforce the typing so that TS knows you're trying to call the new overload of the method, you will get a compiler error because the new type is not exported, e.g.:
    Sentry.showReportDialog({ eventId: event.event_id } as NewReportDialogOptions);
    //                                                  Red squigglies here ^

Expected Result

I should be able to remove the deprecation warning.

Actual Result

Sentry unexported type

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: reactIssues related to the Sentry React SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions