Description
Version info
Angular:
13.0.3
Firebase:
9.4.0
AngularFire:
7.2.0
Other (operating system):
Windows 11 (build version 22000.348)
How to reproduce these conditions
Create a new angular project (using angular cli), then add angular fire (using angular cli)
Steps to set up and reproduce
ng new my-app
cd my-app
ng add @angular/fire (select Firestore option)
ng serve
Debug output
ERROR NullInjectorError: R3InjectorError(AppModule)[AngularFirestore -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options]:
NullInjectorError: No provider for InjectionToken angularfire2.app.options!
at NullInjector.get (core.mjs:11120)
at R3Injector.get (core.mjs:11287)
at R3Injector.get (core.mjs:11287)
at R3Injector.get (core.mjs:11287)
at injectInjectorOnly (core.mjs:4767)
at Module.ɵɵinject (core.mjs:4771)
at Object.AngularFirestore_Factory [as factory] (angular-fire-compat-firestore.js:584)
at R3Injector.hydrate (core.mjs:11457)
at R3Injector.get (core.mjs:11276)
at NgModuleRef.get (core.mjs:21814)
Expected behavior
Get data from Firestore.
Actual behavior
Cannot get data from Firestore.
Current workaround
Replace "provideFirestore(() => getFirestore())," by "AngularFireModule.initializeApp(environment.firebase)," on AppModule.