Bugsnag-js: React-native: Async function swallowing console error

Created on 19 Nov 2020  路  6Comments  路  Source: bugsnag/bugsnag-js

Describe the bug

When an exception occurs in a component function with the async keyword in the signature, the error is not being logged to the console.

Steps to reproduce

  1. Pull down this repo's master branch and run (linked below). This is a clone of the rn063example folder with the changes in App.js to reproduce what I am experiencing.
  2. When the app is running, click the red text button.
  3. Doing this is when I did not see the console error.

Environment

  • Bugsnag version: 7.3.0-alpha.12 (originally experienced on 7.5.2)
  • Browser framework version (if any):

    • React: 0.63.0 (originally experienced on 0.63.2)

  • Device (e.g. iphonex): iPhone 11 (13.2.2) and Pixel 3 XL (API 29)

Example Repo

https://github.com/ShawnCholeva/bugsnag-async-func-error

Example code snippet

Screen Shot 2020-11-18 at 3 01 24 PM


Error messages:
Screen Shot 2020-11-18 at 3 01 37 PM


backlog bug

Most helpful comment

Hey @ShawnCholeva, thanks for raising providing the repro. Confirmed the behaviour you're seeing. We'll take a look into this.

When running without Bugsnag enabled, we'd expect to see a warning when a possible unhandled rejection occurs:
image

With Bugsnag enabled, this unhandled rejection error does get reported to Bugsnag, but it's hidden from the console.

All 6 comments

Just to add more context, I pulled the repo down again and noticed that the "Send Handled JS Exception" and "Trigger Promise Rejection" button from the rn063example also don't show the error in the console.

Hey @ShawnCholeva, thanks for raising providing the repro. Confirmed the behaviour you're seeing. We'll take a look into this.

When running without Bugsnag enabled, we'd expect to see a warning when a possible unhandled rejection occurs:
image

With Bugsnag enabled, this unhandled rejection error does get reported to Bugsnag, but it's hidden from the console.

@xander-jones Also just ran into this. I'm on @bugsnag/react-native@^7.5.0. This bug cost me a bunch of time. My async code was throwing an exception during development and bugsnag was swallowing it. It was sent to BugSnag but async exceptions no longer get logged to console. It took me awhile to figure out because of all things I except an uncaught exception to never just disappear!

IMO this needs to be a high priority bug. It's going to seriously trip up a lot of people's development workflows. What's the last known working version so we can downgrade until there's a fix?

Hi @AndrewMorsillo,

This behaviour will be happening for all versions of @bugsnag/react-native so unfortunately there is no known working version until we can resolve this.

What you could do, is switch off the unhandledRejections error type when in development which may help somewhat in the meantime.

https://docs.bugsnag.com/platforms/android/configuration-options/#enablederrortypes
https://docs.bugsnag.com/platforms/ios/configuration-options/#enablederrortypes

Any update on this @johnkiely1 ? This continues to be a pretty big irritation.

@AndrewMorsillo, this is next up on our to-do list. We'll keep you posted in this thread when an updated release is ready.

Was this page helpful?
0 / 5 - 0 ratings