I’m getting this kind of warning right when I’m logging out from the app:
Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
Error message:
TypeError: _reactNative.Dimensions.removeEventListener is not a function. (In ‘_reactNative.Dimensions.removeEventListener(‘change’, onChange)’, ‘_reactNative.Dimensions.removeEventListener’ is undefined) in BottomTabBar (created by BottomTabView)
in RCTView (created by View)
in View (created by BottomTabView)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by BottomTabView)
in BottomTabView (created by BottomTabNavigator)
in BottomTabNavigator (created by AppNavigator)
in AppNavigator (created by App)
ERROR Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.Error message:
TypeError: _reactNative.Keyboard.removeListener is not a function. (In ‘_reactNative.Keyboard.removeListener(‘keyboardDidShow’, handleKeyboardShow)’, ‘_reactNative.Keyboard.removeListener’ is undefined)
in BottomTabBar (created by BottomTabView)
in RCTView (created by View)
in View (created by BottomTabView)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by BottomTabView)
in BottomTabView (created by BottomTabNavigator)
in BottomTabNavigator (created by AppNavigator)
in AppNavigator (created by App)
This doesn’t actually crash the app and I’m just ignoring this for now.
Nonetheless, a little debugging led me to the place it occurs:
const removeToken = async () => {
try {
await SecureStore.deleteItemAsync(key);
} catch (error) {
console.log("Error removing the auth token", error);
}
};
Any idea why React Native is shouting at SecureStore.deleteItemAsync()
?
How should I resolve this issue?