我使用的是角为14.2.4的AngularFire 7.4.1和RxFire 6.0.3
由于我的角度从12更新到15,AngularFire抛出了以下错误:
ERROR FirebaseError: Expected type 'Ea', but it was: a custom Ta object我正在从@角/火导入所有内容,包括模块设置所需的方法:
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;
}),
...错误源于我的代码的这一部分:
import { Firestore, doc, docData } from "@angular/fire/firestore";
foo() {
return docData(doc(this.firestore, "metadata", "something")).pipe(
map((data) => data?.stringArrayProperty ?? [])
);
}为什么我会有这个错误?
发布于 2022-10-05 16:17:57
结果发现我的node_modules中有一些东西被卡住了,所以运行rimraf -rf node_modules和package-lock.json一样,然后再次运行npm i解决了这个问题。
https://stackoverflow.com/questions/73962996
复制相似问题