@@ -94,8 +94,19 @@ export const setGlobalErrorHandler = once(nativeModule => {
94
94
// Flag the Crashlytics backend that we have a fatal error, they will transform it
95
95
await nativeModule . setAttribute ( FATAL_FLAG , fatalTime ) ;
96
96
97
+ // remember our current deprecation warning state in case users
98
+ // have set it to non-default
99
+ const currentDeprecationWarningToggle =
100
+ globalThis . RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS ;
101
+
97
102
// Notify analytics, if it exists - throws error if not
98
103
try {
104
+ // FIXME - disable warnings and use the old namespaced style,
105
+ // See https://github.com/invertase/react-native-firebase/issues/8381
106
+ // Unfortunately, this fails completely when using modular!
107
+ // Did not matter if I did named imports above or dynamic require here.
108
+ // So temporarily reverting and silencing warnings instead
109
+ globalThis . RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = true ;
99
110
await firebase . app ( ) . analytics ( ) . logEvent (
100
111
'app_exception' , // 'app_exception' is reserved but we make an exception for JS->fatal transforms
101
112
{
@@ -106,6 +117,8 @@ export const setGlobalErrorHandler = once(nativeModule => {
106
117
} catch ( _ ) {
107
118
// This just means analytics was not present, so we could not log the analytics event
108
119
// console.log('error logging analytics app_exception: ' + e);
120
+ } finally {
121
+ globalThis . RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = currentDeprecationWarningToggle ;
109
122
}
110
123
111
124
// If we are chaining to other handlers, just record the error, otherwise we need to crash with it
0 commit comments