From 92f5cea9550ef7bf83ecc6660dccd9cc395263ff Mon Sep 17 00:00:00 2001 From: Goldloli <39011904+Goldloli@users.noreply.github.com> Date: Tue, 1 Dec 2026 11:37:13 +0800 Subject: [PATCH] fix(script-manager): declare jsCallInvoker on RCTBridge for RN 0.89 new arch RN 0.89 removed the RCTBridge (RCTTurboModule) jsCallInvoker declaration from ReactCommon/RCTTurboModule.h, so new-architecture builds failed with "property 'jsCallInvoker' not found on object of type 'RCTBridge *'" in ScriptManager.mm. Re.Pack declared the method only inside #ifndef RCT_NEW_ARCH_ENABLED; move it into a Re.Pack-specific category (RCTBridge (JSICallInvoker)) available on both architectures, mirroring the existing RCTBridge (JSIRuntime) category. Option A from #1528. --- .changeset/fix-script-manager-rn-089-callinvoker.md | 5 +++++ packages/repack/ios/ScriptManager.mm | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/fix-script-manager-rn-089-callinvoker.md diff --git a/.changeset/fix-script-manager-rn-089-callinvoker.md b/.changeset/fix-script-manager-rn-089-callinvoker.md new file mode 100644 index 000000000..97880b5a0 --- /dev/null +++ b/.changeset/fix-script-manager-rn-089-callinvoker.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": patch +--- + +fix(ios): compile `ScriptManager` on React Native 0.89 by declaring `jsCallInvoker` on `RCTBridge` in a Re.Pack-specific category, so the declaration is available on the new architecture after RN 0.89 removed it from `RCTTurboModule.h`. diff --git a/packages/repack/ios/ScriptManager.mm b/packages/repack/ios/ScriptManager.mm index 1dc10e696..4e79d079e 100644 --- a/packages/repack/ios/ScriptManager.mm +++ b/packages/repack/ios/ScriptManager.mm @@ -17,11 +17,16 @@ @interface RCTBridge (JSIRuntime) - (void *)runtime; @end -#ifndef RCT_NEW_ARCH_ENABLED -@interface RCTBridge (RCTTurboModule) +// Declare jsCallInvoker ourselves on both architectures. Up to RN 0.88 the new +// architecture got this declaration from RCTBridge (RCTTurboModule) in +// ReactCommon/RCTTurboModule.h; RN 0.89 removed it, which broke new-architecture +// builds with "property 'jsCallInvoker' not found on object of type 'RCTBridge *'". +// A Re.Pack-specific category name avoids duplicating RN's own category on older +// versions, in the same way as the JSIRuntime category above. The method itself is +// still implemented by RN at runtime. +@interface RCTBridge (JSICallInvoker) - (std::shared_ptr)jsCallInvoker; @end -#endif static NSURLSession * (^_urlSessionFactory)(void) = nil; static NSURLSession *_cachedURLSession = nil;