-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App does not crash as expected #26309
Comments
Hi there, for production builds you can use error boundaries to show an error page on problems inside the render functions of your view and a crash reporting tool (Bugsnag, Sentry, etc..) for debugging. The reason you are not seeing a hard crash of the app is that the view is not rendered correctly on the JS side, so no view information is sent to the native side. There are no crashes on the native side caused by this, native crashes are what you would call a hard crash. This looks like expected behavior to me, which you can deal with by handling errors differently. |
Thanks for the reply. Error boundaries did actual catch the error. I just still don't understand why there is a difference in using promises (async/await) and not. If promises is not used the app does actual crash on the native side. |
I'm facing the same issue in two react-native projects, where previously errors on the javascript side led to hard crashes, allowing our crash reporting tool to receive the error. Was this behavior changed in some release? Having hard crashes allowed us to identify and fix issues more quickly. |
Happen on my project. Instead of crash. App show white screen and crashlog can't receive crash event |
Can you resolve the issue @remanation |
@mtr1012. If you are using for instance BugSnag I know they have an ErrorBoundary component for this scenario |
We have been investigating issues in our app where we just see a white screen and no crash is logged. Goes for both Android and iOS
The issue seem to be related to the use of async/await or promises.
We have found that we can reproduce the white screen issue locally when using async/await or promises.
The issue can be reproduced with the following code (tried to simplify it as much as possible). Replace App.js in a new project with the following:
I also pushed a test project on github
I would expect the app to crash as
isMounted
does not contains atest
method.When running locally I get the red box stating that an error occurred as expected
but when running a release build the app does not crash and no error is reported. This makes it very hard for us to find and fix issues like this as we are totally blind.
If I comment out
It crash as expected in a release build
Are we wrong in assuming that the above code should result in an app crash?
React Native version:
System:
OS: macOS 10.14.5
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Memory: 2.97 GB / 32.00 GB
Shell: 5.6.2 - /usr/local/bin/zsh
Binaries:
Node: 12.3.1 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.11.2 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 23, 26, 27, 28
Build Tools: 26.0.3, 27.0.3, 28.0.3, 29.0.0
System Images: android-23 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
The text was updated successfully, but these errors were encountered: