Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR Class 'FirebaseApp' incorrectly implements interface 'App'

Trying to serve up my angularCLI and Firebase resulted in this error... What do I do?

ERROR in node_modules/angularfire2/app/firebase.app.module.d.ts(5,22): error TS2420: Class 'FirebaseApp' incorrectly implements interface 'App'. Property 'firestore' is missing in type 'FirebaseApp'. node_modules/angularfire2/app/firebase.app.module.d.ts(12,28): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/database/firebase_list_observable.d.ts(14,62): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/database/firebase_list_observable.d.ts(15,48): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/database/firebase_list_observable.d.ts(16,92): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/database/firebase_object_observable.d.ts(11,31): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/database/firebase_object_observable.d.ts(12,37): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/database/firebase_object_observable.d.ts(13,24): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/interfaces.d.ts(12,32): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/interfaces.d.ts(13,35): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/interfaces.d.ts(14,35): error TS2694: Namespace 'firebase' has no exported member 'Promise'. node_modules/angularfire2/interfaces.d.ts(15,44): error TS2694: Namespace 'firebase' has no exported member 'Promise'.

webpack: Failed to compile.

package.json

{
  "name": "oshop",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0",
    "angularfire2": "^4.0.0-rc.1",
    "bootstrap": "^4.0.0",
    "core-js": "^2.4.1",
    "firebase": "^4.9.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.7",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  },
  "description": "This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.7.",
  "main": "karma.conf.js",
  "author": "",
  "repository": {
    "type": "git",
    "url": "imnickvaughn"
  }
}
like image 736
imnickvaughn Avatar asked Feb 03 '18 11:02

imnickvaughn


1 Answers

You should first try: (if you have your angular cli and firebase installed)

  1. In terminal type: npm install -S angularfire2@latest

once you do this your angularfire2 will read: "angularfire2": "^5.0.0-rc.6",

...and thats it

If that's not enough look at these sources and try... https://github.com/angular/angularfire2/issues/1338 https://github.com/angular/angular-cli/issues/4391

npm uninstall -g angular-cli
npm cache clean
npm install -g @angular/cli@latest

rm -rf node_modules dist
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install
ng update [this wasn't working so I just changed it to ng init I believe]

npm install -g firebase-tools
npm install -S angularfire2@latest

Using the above advice and reinstalling all dependencies also works for this problem... npm WARN deprecated [email protected]: use uuid module instead https://github.com/kelektiv/node-uuid/issues/155

...Also the firebase command wouldn't work in my oh-my-zsh until I typed exactly:

npm install -S -D -g firebase-tools

Into vs code terminal.

Hopefully this saves someone an hour or five...

like image 79
imnickvaughn Avatar answered Nov 14 '22 20:11

imnickvaughn