React Native - Sentry.captureException not working

Viewed 958

I'm trying to use Sentry.captureException in my React Native app, but it's not working properly. I'm receiving the eventId, but there is no issues on Sentry website.

Here is the code:

const eventId = Sentry.captureException(new Error("Testing"));
console.log(eventId); /// ccfa8f3799524c8ea9e138fb792******

PS. Native errors are working fine, if I try throw('Testing') it works.

PS. Android only, iOS is working fine

  • RN: 0.63.3
  • @sentry/react-native: 2.0.0
1 Answers

You can use it like this:

Sentry.captureEvent({
    event_id: <error_id>,
    message: <message>,
    extra: <data_in_json>,
});
Related