I have recently upgraded to AngularFire 7.4.1 and Angular 14.2.4, along with RxFire 6.0.3.
After updating Angular from version 12 to 15, I encountered the following error with AngularFire:
ERROR FirebaseError: Expected type 'Ea', but it was: a custom Ta object
I am importing all necessary modules from @angular/fire for setting up my module:
import { connectFirestoreEmulator, getFirestore, provideFirestore } from "@angular/fire/firestore";
...
provideFirestore(() => {
const firestore = getFirestore();
if (!environment.production) {
try {
connectFirestoreEmulator(firestore, "localhost", 8081);
} catch (error) {
console.error(error);
}
}
return firestore;
}),
...
The error seems to be originating from this specific section of my code:
import { Firestore, doc, docData } from "@angular/fire/firestore";
foo() {
return docData(doc(this.firestore, "metadata", "something")).pipe(
map((data) => data?.stringArrayProperty ?? [])
);
}
I'm puzzled as to why this error is occurring. Any thoughts on what might be causing it?