sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Sentry Does Not Log Errors

Open dentep opened this issue 2 years ago • 0 comments

OS:

  • [ ] Windows
  • [x] MacOS
  • [ ] Linux

Platform:

  • [x] iOS
  • [ ] Android

SDK:

  • [x] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: 0.0.0

react-native version: 4.2.3

Are you using Expo?

  • [ ] Yes
  • [x] No

Are you using sentry.io or on-premise?

  • [ ] sentry.io (SaaS)
  • [x] on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

Configuration:

  Sentry.init({
    dsn: SENTRY_URL,
    environment: PRODUCTION ? 'front-prod' : 'front-dev',
    release: `${app.version}-${app.patchVersion}`,
    debug: true,
    beforeSend(event) {
      console.log(JSON.stringify(event, null, 2))

      return event
    },
  })

I have following issue:

Sentry does not send log messages unless they were prefixes with Sentry.captureEvent() or Sentry.captureMessage() or Sentry.captureException(). In the docs, it says that placing throw new Error('This is my first Sentry Error') should send a log to sentry dashboard. JS crashes like those are not getting noticed by sentry for unknown reason.

Steps to reproduce:

  • Add config as stated above
  • On any screen or any button press throw an error

Actual result:

  • An error shows on the device's screen, but it is not logged on the server

Expected result:

  • An error shows on the device's screen and getting sent to sentry's dashboard.

dentep avatar Aug 12 '22 15:08 dentep