question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expo Production Mode

See original GitHub issue

Hello! 👋

Issue Description

I have a React Native application with Expo and I’m trying to throw an error that is triggered by a button.

onPress={() => { throw new Error('This is a test error!'); }}

I’m running the application in Production Mode using expo start --ios --no-dev --minify to see the error screen and try to simulate a real case, but I’m not able to see it. In development mode, I have no problems following the example demo on Expo: https://snack.expo.io/@carloscuesta/react-native-error-boundary.

Would anyone happen to know how I could go about fixing this issue?

Thanks for the help and time!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
carloscuestacommented, Mar 20, 2022

Hey @LucasOliveiraS can you try running the same code from the Expo example in production mode to check if you can see the error screen?

I think the problem is that you’re throwing inside of an event handler and as stated in the React docs, error boundaries don’t catch this

Screen Shot 2022-03-20 at 10 20 57

https://reactjs.org/docs/error-boundaries.html#how-about-event-handlers

1reaction
carloscuestacommented, Mar 19, 2022

Hey! 👋🏼

I’ve been not using Expo for a while, but I found this on the docs:

Screen Shot 2022-03-19 at 10 28 50

Not sure if this will be of any help but my guess is that Expo is handling the error in Production mode reloading the application and you’re not able to see the error screen 😊

Could be related with https://github.com/carloscuesta/react-native-error-boundary/issues/37

Read more comments on GitHub >

github_iconTop Results From Across the Web

Development and production modes - Expo Documentation
Development mode includes useful warnings and gives you access to tools that make development and debugging easier. Production mode minifies your code and ......
Read more >
Expo App works fine on development mode but crashes on ...
I run the app in prod mode without --minify arg (expo start --no-dev) and I was able to fix this issue. Debugging I...
Read more >
App no longer reloads (production mode) with Expo CLI v2 #67
The app does not refresh any more when changes are done in production mode and even after closing it on Android it is...
Read more >
5 common errors found in a React Native app (using Expo)
When creating a mobile app with React Native, you can use Expo to streamline some complexities. Meet the most common errors and how...
Read more >
How to Build and Distribute Any React Native App With New ...
This makes your custom client app lightweight and closer to your production environment. To use Development Builds, install the expo-dev-client ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found