Property 'performance' is missing in type 'FirebaseApp' but required in type 'App'

时间:2019-05-01 08:41:53

标签: angular typescript firebase

I seem to be getting this error when I try to run a fresh install of Angular 7.2 and Firebase:

ERROR in node_modules/@angular/fire/firebase.app.module.d.ts(17,22): error TS2420: Class 'FirebaseApp' incorrectly implements interface 'App'.
  Property 'performance' is missing in type 'FirebaseApp' but required in type 'App'.

Tried switching between different versions of @angular/fire and firebase, but didn't manage to find a working combination.

Current package.json :

{
  "name": "my-app",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "compile:server": "webpack --config webpack.server.config.js --progress --colors",
    "serve:ssr": "node dist/server",
    "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server",
    "build:client-and-server-bundles": "ng build --prod && ng run supynes-full:server:production"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/http": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/platform-server": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@nguniversal/express-engine": "^7.1.1",
    "@nguniversal/module-map-ngfactory-loader": "^7.0.2",
    "core-js": "^2.5.7",
    "dynamic-import-ponyfill": "^0.1.0",
    "firebase": "^5.3.1",
    "flamelink": "^0.19.6",
    "node-fetch": "^2.2.0",
    "rxjs": "^6.2.2",
    "tslib": "^1.9.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.5",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-loader": "^5.2.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2",
    "webpack-cli": "^3.1.0"
  }
}

Has anyone encountered this error? Google doesn't seem to find anything related to the performance property, there are only similar errors, but not the same ones. Any ideas?

4 个答案:

答案 0 :(得分:4)

我也收到此错误。 似乎是最新版本。 firebase的{​​{1}}中的一个已损坏。

将依赖关系更改为 5.11.0 解决了此问题。

重要提示:请勿不要使用任何5.10.0~版本。前缀

答案 1 :(得分:1)

通过将Firebase的版本指定为“ 5.0.4”而不是“ ^ 5.0.4”来解决此问题。

答案 2 :(得分:1)

通过命令将Firebase的版本更改为5.10.1

npm install --save firebase@5.10.1

对我有用。

答案 3 :(得分:0)

问题:

node_modules/@angular/fire/firebase.app.module.d.ts:17:22中的错误-错误 TS2420:类“ FirebaseApp”错误地实现了接口“ App”。
“ FirebaseApp”类型缺少属性“性能”,但在“ App”类型中必需。

17个导出声明类FirebaseApp实现app.App {

node_modules / firebase / index.d.ts:1217:5 1217 performance():firebase.performance.Performance; 此处声明为“性能”。

enter image description here

解决方案:

通过以下命令将firebase的版本更改为5.10.1:

npm install --save firebase@5.10.1

肯定可以。