I'm new to react native dev (I'm using expo go) and firebase firestore. I'm getting errors everywhere. I'm trying to enable local persistence.
Is there a known set of library versions I should use for expo and firebase related libraries? Here are my versions:
├── @babel/core@7.21.3
├── @react-native-async-storage/async-storage@1.17.11
├── expo-firestore-offline-persistence@0.1.0
├── expo-image-picker@14.1.1
├── expo-sqlite@11.1.1
├── expo-status-bar@1.4.4
├── expo@48.0.7
├── firebase@9.18.0
├── firebaseui@6.0.2
├── indexeddbshim@11.0.0-beta.0
├── react-native@0.71.4
└── react@18.2.0
Errors I'm getting when the app initialises:
@firebase/app: Firebase: Error thrown when reading from IndexedDB. Original error: undefined is not a function. (app/idb-get).
and when trying to addDoc():
ERROR [2023-03-24T21:25:41.017Z] @firebase/firestore: Firestore (9.18.0): FIRESTORE (9.18.0) INTERNAL ASSERTION FAILED: Unexpected state
ERROR [2023-03-24T21:25:41.073Z] @firebase/firestore: Firestore (9.18.0): FIRESTORE (9.18.0) INTERNAL ASSERTION FAILED: Unexpected state
ERROR [2023-03-24T21:25:41.107Z] @firebase/firestore: Firestore (9.18.0): FIRESTORE (9.18.0) INTERNAL ASSERTION FAILED: Unexpected state
ERROR [2023-03-24T21:25:41.131Z] @firebase/firestore: Firestore (9.18.0): AsyncQueue Initialization of query 'Query(target=Target(images, filters: [fileName endsWith b8.jpg], orderBy: [__name__ (asc)]); limitType=F)' failed: IndexedDbTransactionError: [code=unavailable]: IndexedDB transaction 'Allocate target' failed: AbortError: A request was aborted (in user handler after success).
WARN Possible Unhandled Promise Rejection (id: 0):
FirebaseError: Initialization of query 'Query(target=Target(images, filters: [fileName endsWith b8.jpg], orderBy: [__name__ (asc)]); limitType=F)' failed: IndexedDbTransactionError: [code=unavailable]: IndexedDB transaction 'Allocate target' failed: AbortError: A request was aborted (in user handler after success).
FirebaseError: [code=unavailable]: Initialization of query 'Query(target=Target(images, filters: [fileName endsWith b8.jpg], orderBy: [__name__ (asc)]); limitType=F)' failed: IndexedDbTransactionError: [code=unavailable]: IndexedDB transaction 'Allocate target' failed: AbortError: A request was aborted (in user handler after success).
From what I can see my settings for firebase are correct.
Here's my metro.config.js:
const { getDefaultConfig } = require("@expo/metro-config");
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.assetExts.push("cjs");
module.exports = defaultConfig;
Thanks in advance.