David Haddad
David Haddad

Reputation: 3936

Series of Ionic / Firebase AngularFire2 Errors After Reinstalling NPM Packages

Within an ionic app, all npm packages have been removed and reinstalled with npm install. Now running ionic serve displays about a dozen errors mostly related to firebase and angularfire2.

enter image description here

To debug,

  1. I've uninstalled and reinstalled angularfire2 and firebase
  2. I've double checked the tsconfig.json file which looks the same as before the error started
  3. I've restarted the server

And yet, still nothing....

There are also some npm warnings related to unavailable peer dependencies which I'm attaching below and I'm not quite sure how to handle...

enter image description here

Here's the main app's package.json dependency list:

"dependencies": {
    "@angular/compiler": "^4.4.4",
    "@angular/compiler-cli": "^4.4.4",
    "@angular/core": "^4.4.4",
    "@angular/forms": "^4.4.4",
    "@angular/http": "^4.4.4",
    "@angular/platform-browser": "^4.4.4",
    "@angular/platform-browser-dynamic": "^4.4.4",
    "@ionic-native/app-availability": "^4.3.0",
    "@ionic-native/call-number": "^4.3.0",
    "@ionic-native/clipboard": "^4.3.0",
    "@ionic-native/core": "^4.3.0",
    "@ionic-native/device": "^4.3.0",
    "@ionic-native/facebook": "^4.3.0",
    "@ionic-native/geolocation": "^4.3.0",
    "@ionic-native/in-app-browser": "^4.3.0",
    "@ionic-native/sms": "^4.3.0",
    "@ionic-native/social-sharing": "^4.3.0",
    "@ionic-native/splash-screen": "^4.3.0",
    "@ionic-native/status-bar": "^4.3.0",
    "@ionic/storage": "2.0.1",
    "angularfire2": "^5.0.0-rc.1",
    "babel-code-frame": "^6.26.0",
    "call-number": "^1.0.1",
    "chalk": "^2.1.0",
    "cordova-android": "^6.3.0",
    "cordova-browser": "^5.0.0",
    "cordova-clipboard": "^1.1.0",
    "cordova-ios": "^4.5.1",
    "cordova-plugin-appavailability": "^0.4.2",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-facebook4": "^1.9.1",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-queries-schemes": "^0.1.5",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova-plugin-x-socialsharing": "^5.2.0",
    "cordova-sms-plugin": "^0.1.11",
    "debug": "^3.1.0",
    "es6-promise-plugin": "^4.1.1",
    "firebase": "^4.5.0",
    "ionic-angular": "^3.7.1",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "ios-sim": "^6.1.2",
    "json5": "^0.5.1",
    "minimatch": "^3.0.4",
    "promise-polyfill": "6.0.2",
    "rxjs": "^5.4.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "^0.8.18"
},
"devDependencies": {
    "@angular/common": "^4.4.3",
    "@ionic/app-scripts": "3.0.0",
    "install": "^0.10.1",
    "npm": "^5.5.0",
    "typescript": "^2.5.3"
},
"peerDependencies": {},

Upvotes: 0

Views: 143

Answers (2)

alltej
alltej

Reputation: 7285

With angularfire2 version 5.0.0+, the FirebaseListObservable and FirebaseObjectObservable is deprecated. Please revert back to the 4.0.0.+ versions

Upvotes: 1

David Haddad
David Haddad

Reputation: 3936

Ok, after troubleshooting this with the help of @alltej it looks like I was not careful enough with npm update command leading the AngularFire2 and Firebase npm packages to both be upgraded to versions with a major version number change leading to some breaking changes.

For example, FirebaseObjectObservable which was being used throughout the app is has been deprecated in version 5. Rolling back to a previous version solved the issue/

Upvotes: 0

Related Questions