我们安装了 angular firebase
npm install firebase angularfire2 --save
并且出现了这个错误
ERROR in node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2420: Class 'FirebaseApp' incorrectly implements interface 'FirebaseApp'.
Property 'automaticDataCollectionEnabled' is missing in type 'FirebaseApp'.
我该如何解决?
最佳答案
我建议不要直接修改您的node_modules
。这是不必要的错误做法,因为您的更改将被更新覆盖。
Op 的错误似乎是在结合使用最新的 firebase@4.13.1
和 angularfire2@5.0.0-rc.6
时发生的。
解决方案:
有些人建议降级 firebase
包,但更好的选择可能是安装 @firebase/app@^0.1.10
,它修复了我的错误。
注意:
最新的 firebase 4.13.1
引入了对 Firestore Timestamp/Date 对象的一些更改,我已经实现了这些更改,如果降级 firebase
包则必须还原。
关于angular - 类型 'automaticDataCollectionEnabled' 中缺少属性 'FirebaseApp',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49963223/