ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AuthModule)[AuthService -> AuthService -> AngularFirestore -> InjectionToken
See original GitHub issueAngular: 13.0.3
Firebase: 9.4.0
AngularFire: 7.2.0
After upgrade angularfire 6 to 7 i got error
ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AuthModule)[AuthService -> AuthService -> AngularFirestore -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options -> InjectionToken angularfire2.app.options]
simple if i can it any component constructor
private firebaseAuth: AngularFireAuth,
or
private angularFirestore: AngularFirestore,
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:14
Top Results From Across the Web
NullInjectorError: No provider for InjectionToken angularfire2 ...
The fix is actually really simple... in your app.module.ts. import import { FIREBASE_OPTIONS } from '@angular/fire/compat';.
Read more >Uncaught (in promise): NullInjectorError: R3InjectorError ...
ERROR Error : Uncaught (in promise): NullInjectorError: R3InjectorError(AuthModule)[AuthService -> AuthService -> AngularFirestore -> ...
Read more >NG0201: No provider for {token} found! - Angular
You see this error when you try to inject a service but have not declared a corresponding provider. A provider is a mapping...
Read more >EXCEPTION: Error: Uncaught (in promise): No provider for ...
I'm stuck on this one error. I'm not sure what I'm doing wrong, or if it's some issue with beta 12 of the...
Read more >Ionic 4 : Error: Uncaught (in promise): NullInjectorError
Ionic 4 : Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[AngularFireAuth -> InjectionToken angularfire2.app.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! This works for me. I put this in app.module.ts
import { FIREBASE_OPTIONS } from ‘@angular/fire/compat’;
@NgModule({ … providers: [ { provide: FIREBASE_OPTIONS, useValue: environment.firebaseConfig } ], })
I see this pretty chaotic. The samples are so out of date and one cannot really follow them. I am getting the same errors.
I was able to initialize my module like this, and I try to stay our of compact/ package as it gives tons of errors.
I am not really sure which API or which documentation should I follow
https://github.com/angular/angularfire/blob/master/site/src/auth/route-guards.md or https://github.com/angular/angularfire/blob/master/docs/auth/router-guards.md
If I use the one from /site/ then it is also out of sync with latest code as this import is invalid.