expo-camera and @react-native-firebase plugins compatible build error

1 week ago 13
ARTICLE AD BOX

I have a project that requires the use of both react-native-firebase and expo-camera plugins. The issue is anytime I try to run or prebuild the project, it immediately errors out (see image below)

powershell - npm run dev-android -> fails

Error:

PluginError: Package "@react-native-firebase/app" does not contain a valid config plugin. Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin Unexpected token 'typeof' SyntaxError: Unexpected token 'typeof' at compileSourceTextModule (node:internal/modules/esm/utils:318:16) at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:380:18) at loadESMFromCJS (node:internal/modules/cjs/loader:1578:24) at Module._compile (node:internal/modules/cjs/loader:1743:5) at Object..js (node:internal/modules/cjs/loader:1893:10) at Module.load (node:internal/modules/cjs/loader:1481:32) at Module._load (node:internal/modules/cjs/loader:1300:12) at TracingChannel.traceSync (node:diagnostics_channel:328:14) at wrapModuleLoad (node:internal/modules/cjs/loader:245:24) at Module.require (node:internal/modules/cjs/loader:1504:12)

I created a project to reproduce the error here: https://github.com/jamespageced/expo-camera-with-firebase-build-error/tree/failure?tab=readme-ov-file

package.json contents

{ "name": "demo", "version": "1.0.0", "main": "index.ts", "scripts": { "dev-android": "cross-env NODE_ENV=development npx expo run:android --port 8082", "dev-ios": "cross-env NODE_ENV=development npx expo run:ios --port 8082", "prod-android": "cross-env NODE_ENV=production npx expo run:android --port 8082", "prod-ios": "cross-env NODE_ENV=production npx expo run:ios --port 8082", "ts-check": "tsc", "android": "expo run:android", "ios": "expo run:ios" }, "dependencies": { "@react-native-firebase/app": "^23.7.0", "@react-native-firebase/auth": "^23.7.0", "@react-native-firebase/crashlytics": "^23.7.0", "expo": "~53.0.24", "expo-asset": "~11.1.7", "expo-build-properties": "~0.14.8", "expo-camera": "~16.1.11", "expo-system-ui": "~5.0.11", "expo-status-bar": "~2.2.3", "react": "19.0.0", "react-native": "0.79.6" }, "devDependencies": { "@babel/core": "^7.25.2", "@types/node": "^24.10.2", "@types/react": "~19.0.10", "cross-env": "^10.1.0", "react-native-dotenv": "^3.4.11", "typescript": "~5.8.3" }, "private": true }

app.config.js contents

module.exports = { name: 'demo', slug: 'demo', version: '1.0.0', orientation: 'portrait', icon: './assets/icon.png', userInterfaceStyle: 'light', newArchEnabled: true, splash: { image: './assets/splash-icon.png', resizeMode: 'contain', backgroundColor: '#ffffff' }, ios: { supportsTablet: true }, android: { adaptiveIcon: { foregroundImage: './assets/adaptive-icon.png', backgroundColor: '#ffffff' }, package: 'com.anonymous.demo', edgeToEdgeEnabled: true }, web: { favicon: './assets/favicon.png' }, plugins: [ ['@react-native-firebase/app'], ['@react-native-firebase/auth'], ['@react-native-firebase/crashlytics'], [ 'expo-camera', { cameraPermission: 'Allow $(PRODUCT_NAME) to access your camera', microphonePermission: 'Allow $(PRODUCT_NAME) to access your microphone', recordAudioAndroid: true } ], [ 'expo-build-properties', { android: { minSdkVersion: 26, compileSdkVersion: 35, targetSdkVersion: 35 }, ios: { useFrameworks: 'static' } } ] ] };
Read Entire Article