Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

AngularFire's getAuth() causing "No Firebase App '[DEFAULT]' has been created" error

$
0
0

My Ionic 5 app uses Angular/fire, and the app.module.ts contains the following:

import { environment } from '../environments/environment';
import { initializeApp,provideFirebaseApp } from '@angular/fire/app';
import { provideAuth,getAuth } from '@angular/fire/auth';

// ..blah blah blah

@NgModule({
  // ...
  imports: [
    //...
    provideFirebaseApp(() => initializeApp(environment.firebase)),
    provideAuth(() => getAuth()),
    //...
    ]

But when I run it, I get the error (referencing getAuth()

ERROR Error: Uncaught (in promise): FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
    at getApp (index.esm2017.js:459)
    at getAuth (index-8593558d.js:9298)
    at angular-fire.js:225
///....

What the heck??? It worked fine last week. Not sure what changed since then!

How can I fix this?
Here’s the package.json

{
  "name": "servicefinder",
  "version": "0.10.1",
  "author": "Obinna Ezeilo",
  "homepage": "https://servicefinderapp.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "12.2.14",
    "@angular/core": "12.2.14",
    "@angular/fire": "^7.1.0",
    "@angular/forms": "12.2.14",
    "@angular/platform-browser": "12.2.14",
    "@angular/platform-browser-dynamic": "12.2.14",
    "@angular/router": "12.2.14",
    "@capacitor/android": "^3.3.3",
    "@capacitor/app": "1.0.6",
    "@capacitor/camera": "^1.2.1",
    "@capacitor/core": "3.3.2",
    "@capacitor/filesystem": "^1.0.6",
    "@capacitor/haptics": "1.1.3",
    "@capacitor/ios": "3.3.3",
    "@capacitor/keyboard": "1.1.3",
    "@capacitor/push-notifications": "^1.0.7",
    "@capacitor/splash-screen": "^1.2.0",
    "@capacitor/status-bar": "^1.0.6",
    "@capacitor/storage": "^1.2.3",
    "@ionic-native/camera": "5.32.1",
    "@ionic-native/core": "5.32.1",
    "@ionic-native/file": "5.32.1",
    "@ionic-native/firebase-authentication": "^5.32.1",
    "@ionic-native/image-picker": "^5.32.1",
    "@ionic-native/splash-screen": "^5.32.1",
    "@ionic-native/status-bar": "5.32.1",
    "@ionic-native/stripe": "5.32.1",
    "@ionic/angular": "5.6.5",
    "@ionic/pwa-elements": "^3.0.2",
    "@ungap/global-this": "^0.4.4",
    "angular4-paystack": "3.0.2",
    "cordova": "^10.0.0",
    "cordova-ios": "6.2.0",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-image-picker": "^1.1.3",
    "cordova-sqlite-storage": "6.0.0",
    "cordova-support-android-plugin": "1.0.2",
    "cordova-support-google-services": "^1.4.1",
    "core-js": "^3.11.0",
    "firebase": "9.6.0",
    "formidable": "^3.1.5",
    "globalthis": "^1.0.2",
    "npm-check-updates": "^11.5.4",
    "rxfire": "6.0.0",
    "rxjs": "6.6.7",
    "tslib": "2.2.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/architect": "0.1202.13",
    "@angular-devkit/build-angular": "12.2.13",
    "@angular-devkit/core": "12.2.13",
    "@angular-devkit/schematics": "12.2.13",
    "@angular/cli": "12.2.13",
    "@angular/compiler": "12.2.14",
    "@angular/compiler-cli": "12.2.14",
    "@angular/language-service": "12.2.14",
    "@capacitor/cli": "3.3.2",
    "@ionic/angular-toolkit": "3.1.1",
    "@ionic/lab": "3.2.10",
    "@types/jasmine": "3.9.1",
    "@types/jasminewd2": "~2.0.10",
    "@types/node": "~15.0.1",
    "codelyzer": "^6.0.1",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-whitelist": "^1.3.4",
    "jasmine-core": "3.9.0",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "^6.3.2",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "npm-force-resolutions": "0.0.10",
    "protractor": "7.0.0",
    "ts-node": "~9.1.1",
    "tslint": "6.1.3",
    "typescript": "4.3.5"
  },
  "description": "Service Finder",
  "cordova": {
    "plugins": {
      "cordova-plugin-image-picker": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-file": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-firebase-authentication": {}
    },
    "platforms": [
      "ios"
    ]
  },
  "resolutions": {
    "@babel/preset-env": "^7.8.7"
  }
}

Thanks.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles