I installed RNF from starter kit provided by Invertase. I am using RNF app, database, analytics, auth. Everything worked fine until I needed the auth module. It throws an error on app startup (on Android, haven't tried iOS):
...\node_modules\react-native\Libraries\Core\ExceptionsManager.js:86
You've attempted to require '@react-native-firebase/auth' version '6.0.3', however,
the '@react-native-firebase/app' module is of a different version (6.0.0).
All React Native Firebase modules must be of the same version.
Please ensure they match up in your package.json file and re-run yarn/npm install.
But I checked in package.json of all the modules are of version 6.0.3, and my package.json also looks good:
{
"name": "meditationapp",
"version": "6.0.3",
"private": true,
"scripts": {
"start": "react-native start",
"run:android": "react-native run-android",
"run:ios": "react-native run-ios --simulator=\"iPhone 11 Pro Max\"",
"build:apk": "cd android && ./gradlew assembleRelease",
"test": "jest",
"prepare": "patch-package",
"storybook": "start-storybook -p 7007"
},
"dependencies": {
"@react-native-community/async-storage": "^1.6.2",
"@react-native-community/netinfo": "^4.4.0",
"@react-native-firebase/analytics": "6.0.3",
"@react-native-firebase/app": "6.0.3",
"@react-native-firebase/auth": "6.0.3",
"@react-native-firebase/database": "6.0.3",
"@typescript-eslint/eslint-plugin": "^2.3.3",
"@typescript-eslint/parser": "^2.3.3",
...
Import in App.tsx:
import firebase from '@react-native-firebase/app'
import database from '@react-native-firebase/database'
import analytics from '@react-native-firebase/analytics'
import auth from '@react-native-firebase/auth'
Things I've tried:
npm install
Can't think of anything else to try, but the error does not go away. It's working fine with analytics and database, only auth is an issue.
Found this to be an issue with the caches.
npm install
The project now has all RNF modules with version 6.0.3