I've upgraded to the latest version of @angular/fire recently, and everything worked fine, but now I've migrated away from the compat libraries, and now I'm stuck with this issue. I get this error on the following code:
Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp().
// ...
import {getAuth, provideAuth} from '@angular/fire/auth';
import {getFirestore, provideFirestore} from '@angular/fire/firestore';
import {initializeApp, provideFirebaseApp} from '@angular/fire/app';
// ...
@NgModule({
// ...
providers: [
// ...
provideFirebaseApp(() => initializeApp(window['firebase_config'])),
provideFirestore(() => getFirestore()),
provideAuth(() => getAuth()),
// ...
],
// ...
})
export class ApModule {
// ...
}
Here is the stack trace:
Error: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
at new ZoneAwareError (http://localhost:4200/vendor.js:65953:33)
at new FirebaseError (http://localhost:4200/apps_frontend_src_app_app_module_ts.js:166709:5)
at ErrorFactory.create (http://localhost:4200/apps_frontend_src_app_app_module_ts.js:166739:19)
at getApp (http://localhost:4200/apps_frontend_src_app_app_module_ts.js:122971:25)
at getAuth (http://localhost:4200/apps_frontend_src_app_app_module_ts.js:137360:77)
at http://localhost:4200/apps_frontend_src_app_app_module_ts.js:69140:44
at http://localhost:4200/apps_frontend_src_app_app_module_ts.js:69066:57
at ZoneDelegate.invoke (http://localhost:4200/polyfills.js:463:26)
at Zone.run (http://localhost:4200/polyfills.js:225:43)
at NgZone.runOutsideAngular (http://localhost:4200/vendor.js:34688:28)
at runOutsideAngular (http://localhost:4200/apps_frontend_src_app_app_module_ts.js:69066:33)
at http://localhost:4200/apps_frontend_src_app_app_module_ts.js:69140:17
at http://localhost:4200/apps_frontend_src_app_app_module_ts.js:1581:144
at http://localhost:4200/apps_frontend_src_app_app_module_ts.js:68430:47
at ZoneDelegate.invoke (http://localhost:4200/polyfills.js:463:26)
I'm totally confused on why I'm getting this error. Any help is much appreciated!