How to deal with Expo "bluescreen" errors

These are the sort of errors I’m talking about:


In my ExpoKit SDK 32 app, I have sentry-expo configured, and I get all sorts of errors that are typically “yellowbox” in development (e.g., unhandled promise rejection) reported, but I’ve never seen an error that appears in the “blue screen” above reported (which as I understand from the docs should be any redbox errors). So my questions:

  1. Is the expected behavior that sentry-expo reports all of the errors that would generate a restart / result in a blue screen?

  2. Can I subscribe to an event to see these errors in JS? It sounds like componentDidCatch might do it. Then at least I could generate custom Sentry errors.

  3. Is there any way to suppress the blue screen? It’s the one part of my apps where the Expo branding bleeds through (and I don’t really like showing raw error debug messages to my users). I’d rather the app just crashes, then at least I’d get a Play Store console crash report.


Hey @llamaluvr!

sentry-expo is just a wrapper for react-native-sentry, so it shouldn’t have different behavior than it. I believe this is the expected behavior. I’ve seen a couple ways of catching all errors just by searching previously, so I don’t know if there’s an established “best practice”, but I think your method would work fine.

For (3)- This is actually planned right now (although I don’t have an ETA for you, yet) You can keep track of it here

Thanks for the info @charliecruzan!

I did some additional testing and confirmed that I do get sentry errors for JavaScript redbox errors. These usually trigger a reload in the app. I do not get the sentry errors like this error originating from the native side, like this one:

(this is this somewhat notorious error:

What’s kind of confusing is that both of these errors generate redboxes in development, but I guess I can see the difference between the two and why one might get picked up and the other not.

Any way you could point me in the direction of what code causes the bluescreen to display (e.g., a link to the source in Github?). I’ve tried and not been able to track it down. Wondering if I could figure out something to intercept the error in native code so I could report on it.

Thanks for the heads-up on the open issue. Really looking forward to the fix! I just realized that it’s a lot more than just a cosmetic issue. In the case of the error above, it throws the entire app into an unstable state that can’t be recovered by reloading the JavaScript, so pressing that reload button just keeps bringing the error up again until the user force-closes it (which can be a bit confusing to the less technically-inclined).

Mmm… wish I could point to one place, but I don’t think it’s that centralized. Afaik, all uncaught native errors result in the (disheartening) blue screen

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.