Issue
On iOS, building an Expo SDK 55 / React Native 0.83.4 app that uses @react-native-firebase/firestore@24.0.0 with use_frameworks!: :static fails with:
node_modules/@react-native-firebase/firestore/ios/RNFBFirestore/RNFBFirestoreCommon.h:40:42:
error: cannot find 'RCTPromiseRejectBlock' in scope
+ (void)promiseRejectFirestoreException:(RCTPromiseRejectBlock)reject error:(NSError *)error;
^
Similar errors are also raised in RNFBFirestoreCollectionModule.h and the other Firestore headers that expose methods taking RCTPromiseRejectBlock / RCTResponseSenderBlock.
Root cause
Two separate issues in the shipped iOS sources of @react-native-firebase/firestore@24.0.0:
-
Header import order. In every .h under ios/RNFBFirestore/, #import <Firebase/Firebase.h> is placed before #import <React/RCTBridgeModule.h>:
// RNFBFirestoreCommon.h (current)
#import <Firebase/Firebase.h>
#import <React/RCTBridgeModule.h>
With Expo's default use_frameworks!: :static + Xcode 26, resolving Firebase first seems to prevent React/RCTBridgeModule.h from contributing its block typedefs into scope, so RCTPromiseRejectBlock / RCTResponseSenderBlock are not visible to later declarations in the same file.
-
Missing import in .m sources. Several implementation files call RCTPromiseRejectBlock / RCTResponseSenderBlock but never import <React/RCTBridgeModule.h> directly — they were relying on the header chain picking it up. Affected files:
RNFBFirestoreCollectionModule.m
RNFBFirestoreCommon.m
RNFBFirestoreDocumentModule.m
RNFBFirestoreModule.m
RNFBFirestoreTransactionModule.m
Why this is not #8883
#8883 covers RN 0.84's pre-compiled rncore colliding with RNFB modulemaps across all RNFB pods (Auth / Messaging / Firestore etc.). This project runs RN 0.83.4, where RCT_USE_PREBUILT_RNCORE is not set and the pre-compiled default is off. Also only @react-native-firebase/firestore failed to compile — @react-native-firebase/app and @react-native-firebase/auth built without any patch. The workaround for #8883 (Podfile preinstall hook to force-static RNFB, or RCT_USE_PREBUILT_RNCORE=0) does not address the import declarations in Firestore sources.
Steps to reproduce
- Create an Expo SDK 55 app (RN 0.83.4) with
use_frameworks!: :static, Xcode 26 / iOS 15.1 deployment target.
- Install
@react-native-firebase/app@^24, @react-native-firebase/auth@^24, @react-native-firebase/firestore@^24.
npx expo prebuild --clean && npx expo run:ios.
- Build fails at
RNFBFirestoreCommon.h:40 with cannot find 'RCTPromiseRejectBlock' in scope.
Workaround applied (patch-package style)
Two edits across the Firestore iOS sources:
a) Reorder .h imports so React comes before Firebase
-#import <Firebase/Firebase.h>
-#import <React/RCTBridgeModule.h>
+#import <React/RCTBridgeModule.h>
+#import <Firebase/Firebase.h>
Applied to every file under ios/RNFBFirestore/ that imports both (RNFBFirestoreCommon.h, RNFBFirestoreCollectionModule.h, RNFBFirestoreDocumentModule.h, RNFBFirestoreModule.h, RNFBFirestoreQuery.h, RNFBFirestoreSerialize.h, RNFBFirestoreTransactionModule.h).
b) Add <React/RCTBridgeModule.h> to each .m that uses RCTPromiseRejectBlock / RCTResponseSenderBlock
+#import <React/RCTBridgeModule.h>
#import <RNFBApp/RNFBRCTEventEmitter.h>
Applied to the five .m files listed above.
After these two edits, npx expo run:ios succeeds and Firestore reads/writes (including emulator-based E2E) pass.
Project Files
Javascript
Click To Expand
package.json (excerpt):
```json
{
"dependencies": {
"expo": "~55.0.15",
"react": "19.2.0",
"react-native": "0.83.4",
"@react-native-firebase/app": "24.0.0",
"@react-native-firebase/auth": "24.0.0",
"@react-native-firebase/firestore": "24.0.0"
}
}
```
iOS
Click To Expand
ios/Podfile.properties.json:
```json
{
"expo.jsEngine": "hermes",
"ios.deploymentTarget": "15.1",
"ios.useFrameworks": "static"
}
```
Podfile itself is generated by Expo prebuild and is not manually customized.
Environment
- Platform: iOS (not tested on Android; Android builds are green with the same package versions in our project)
react-native-firebase version: 24.0.0 for app, auth, firestore
- Firebase module(s) with the issue: firestore (auth and app build fine without any patch)
- TypeScript: Y, ~5.9.2
- React Native: 0.83.4 (Expo SDK 55)
- Xcode: 26.0.1 on macOS 26.4
- iOS deployment target: 15.1
use_frameworks!: :static (via expo-build-properties)
RCT_USE_PREBUILT_RNCORE not set (RN 0.83 default)
`react-native info` is tricky to produce from a fully-Expo project; happy to supply a sample repo if useful.
Thanks for maintaining this library. Let me know if you'd like a PR that just reorders the imports and adds the missing <React/RCTBridgeModule.h> in the five .m sources — the change is mechanical and non-breaking on older RN versions.
Issue
On iOS, building an Expo SDK 55 / React Native 0.83.4 app that uses
@react-native-firebase/firestore@24.0.0withuse_frameworks!: :staticfails with:Similar errors are also raised in
RNFBFirestoreCollectionModule.hand the other Firestore headers that expose methods takingRCTPromiseRejectBlock/RCTResponseSenderBlock.Root cause
Two separate issues in the shipped iOS sources of
@react-native-firebase/firestore@24.0.0:Header import order. In every
.hunderios/RNFBFirestore/,#import <Firebase/Firebase.h>is placed before#import <React/RCTBridgeModule.h>:With Expo's default
use_frameworks!: :static+ Xcode 26, resolving Firebase first seems to preventReact/RCTBridgeModule.hfrom contributing its block typedefs into scope, soRCTPromiseRejectBlock/RCTResponseSenderBlockare not visible to later declarations in the same file.Missing import in
.msources. Several implementation files callRCTPromiseRejectBlock/RCTResponseSenderBlockbut never import<React/RCTBridgeModule.h>directly — they were relying on the header chain picking it up. Affected files:RNFBFirestoreCollectionModule.mRNFBFirestoreCommon.mRNFBFirestoreDocumentModule.mRNFBFirestoreModule.mRNFBFirestoreTransactionModule.mWhy this is not #8883
#8883covers RN 0.84's pre-compiled rncore colliding with RNFB modulemaps across all RNFB pods (Auth / Messaging / Firestore etc.). This project runs RN 0.83.4, whereRCT_USE_PREBUILT_RNCOREis not set and the pre-compiled default is off. Also only@react-native-firebase/firestorefailed to compile —@react-native-firebase/appand@react-native-firebase/authbuilt without any patch. The workaround for #8883 (Podfile preinstall hook to force-static RNFB, orRCT_USE_PREBUILT_RNCORE=0) does not address the import declarations in Firestore sources.Steps to reproduce
use_frameworks!: :static, Xcode 26 / iOS 15.1 deployment target.@react-native-firebase/app@^24,@react-native-firebase/auth@^24,@react-native-firebase/firestore@^24.npx expo prebuild --clean && npx expo run:ios.RNFBFirestoreCommon.h:40withcannot find 'RCTPromiseRejectBlock' in scope.Workaround applied (patch-package style)
Two edits across the Firestore iOS sources:
a) Reorder
.himports so React comes before FirebaseApplied to every file under
ios/RNFBFirestore/that imports both (RNFBFirestoreCommon.h,RNFBFirestoreCollectionModule.h,RNFBFirestoreDocumentModule.h,RNFBFirestoreModule.h,RNFBFirestoreQuery.h,RNFBFirestoreSerialize.h,RNFBFirestoreTransactionModule.h).b) Add
<React/RCTBridgeModule.h>to each.mthat usesRCTPromiseRejectBlock/RCTResponseSenderBlock+#import <React/RCTBridgeModule.h> #import <RNFBApp/RNFBRCTEventEmitter.h>Applied to the five
.mfiles listed above.After these two edits,
npx expo run:iossucceeds and Firestore reads/writes (including emulator-based E2E) pass.Project Files
Javascript
Click To Expand
package.json(excerpt):```json
{
"dependencies": {
"expo": "~55.0.15",
"react": "19.2.0",
"react-native": "0.83.4",
"@react-native-firebase/app": "24.0.0",
"@react-native-firebase/auth": "24.0.0",
"@react-native-firebase/firestore": "24.0.0"
}
}
```
iOS
Click To Expand
ios/Podfile.properties.json:```json
{
"expo.jsEngine": "hermes",
"ios.deploymentTarget": "15.1",
"ios.useFrameworks": "static"
}
```
Podfileitself is generated by Expo prebuild and is not manually customized.Environment
react-native-firebaseversion: 24.0.0 forapp,auth,firestoreuse_frameworks!: :static (via expo-build-properties)RCT_USE_PREBUILT_RNCOREnot set (RN 0.83 default)`react-native info` is tricky to produce from a fully-Expo project; happy to supply a sample repo if useful.
Thanks for maintaining this library. Let me know if you'd like a PR that just reorders the imports and adds the missing
<React/RCTBridgeModule.h>in the five.msources — the change is mechanical and non-breaking on older RN versions.