-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
Unhandled promises result in white screen of death (silent exceptions) #31115
Comments
Any reason you're using components from react-native-gesture-handler and react-native-animatable? The ones you're using should be in core. |
|
@chrisglein crash is not defined on purpose, the app should crash when the button is pushed. https://snack.expo.io/@alita-moore/repro31115 import * as React from 'react';
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
export const forceCrash = () => {
crash();
};
const forceCrashPromise = async () => forceCrash();
const forceCrashNotPromise = () => forceCrash();
const Button = () => (
<View>
<TouchableOpacity onPress={forceCrashPromise} style={{margin: 30}}>
<Text>Force Crash Promise</Text>
</TouchableOpacity>
<TouchableOpacity onPress={forceCrashNotPromise} style={{margin: 30}}>
<Text>Force Crash Not Promise</Text>
</TouchableOpacity>
</View>
);
export default function App() {
return (
<Button/>
);
} If you click Notably, on the actual device the screen goes white but the point is despite the unhandled exception, the regular exception handling is not triggered |
@chrisglein have you had a chance to look into this? |
@alita-moore No expertise I can lend here. Just trying to help triage incoming issues so they have the best chance of success. |
Description
Exceptions that occur within an unhandled promise do not trigger React exception handling. This makes it impossible to track exceptions or use standard exception handling methods. We call this the white screen of death.
React Native version:
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
Both buttons should show a RED screen or white screen should trigger exception handling
Snack, code example, screenshot, or link to a repository:
The text was updated successfully, but these errors were encountered: