-
Notifications
You must be signed in to change notification settings - Fork 2.2k
AngularFirestore InjectionToken Error - Angular v13 + Firestore v7 #3088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does this related to angular compact can't initialize?
|
Same with mac M1 while using FirebaseAuth |
Cutting 7.2.1 with the fix now |
Same issue here while using AngularAuth:
|
I solved:
|
@jamesdaniels the issue persists, while using the default providers(setup during initialization), have to resort to above comment |
I'm still getting the error. "angular": "13.3.0"
"firebase": "^9.4.0",
"@angular/fire": "^7.3.0",
"typescript": "~4.4.4" And, if I try to use
To make it work, I had to disable everything from AOT compiler "buildOptimizer": false,
"extractLicenses": false,
"aot": false,
"optimization": true,
"commonChunk": true |
Not sure if it's the exact same issue, but this solved it for me: In your app.module.ts
Please refer to: |
mayacr86 solution worked for me. |
I am still getting the same error NullInjectorError: R3InjectorError(HomePageModule)[AvatarService -> AvatarService -> Storage -> Storage -> Storage]:
NullInjectorError: No provider for Storage! |
mayacr86 Thank you, your solution worked successfully:) |
@mayacr86 THANK YOU! |
Thank you @mayacr86 💯 |
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.
The text was updated successfully, but these errors were encountered: