From b3e07f9614ac97e43db298922ace1db84cd084c2 Mon Sep 17 00:00:00 2001 From: Yousif <74918474+yousif-bugsnag@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:53:22 +0100 Subject: [PATCH] fix(react-native): initialise synchronously in bridgeless mode (#2165) --- CHANGELOG.md | 1 + packages/react-native/src/notifier.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11bbf4f03..9febc7107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ ### Fixed - (react-native) Use synchronous native module calls when New Architecture is enabled [#2152](https://github.com/bugsnag/bugsnag-js/pull/2152) +- (react-native) Ensure client is initialised synchronously in bridgeless mode [#2165](https://github.com/bugsnag/bugsnag-js/pull/2165) ## [7.24.0] - 2024-06-10 diff --git a/packages/react-native/src/notifier.js b/packages/react-native/src/notifier.js index 4d16dd7c5..2d28b518f 100644 --- a/packages/react-native/src/notifier.js +++ b/packages/react-native/src/notifier.js @@ -9,9 +9,9 @@ This only affects the remote debugger. Execution of JS in the normal way (on the // this is how some internal react native code detects whether the app is running // in the remote debugger: -// https://github.com/facebook/react-native/blob/1f4535c17572df78e2a033890220337e5703b614/Libraries/ReactNative/PaperUIManager.js#L62-L66 +// https://github.com/facebook/react-native/blob/e320ab47cf855f2e5de74ea448ec292cf0bbb29a/packages/react-native/Libraries/Utilities/DebugEnvironment.js#L15 // there's no public api for this so we use the same approach -const isDebuggingRemotely = !global.nativeCallSyncHook +const isDebuggingRemotely = !global.nativeCallSyncHook && !global.RN$Bridgeless const name = 'Bugsnag React Native' const { version } = require('../package.json')