Version info
Angular: 8.2.14
Firebase: 7.6.2
AngularFire: 5.3.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): N/A
How to reproduce these conditions
I've captured the issue in a simple project on StackBlitz:
https://stackblitz.com/edit/angular-scftvu
Steps to set up and reproduce
- Open the console at the bottom of the StackBlitz-rendered browser
- Click between the "Public", "Protected" and "Login" hyperlinks.
Debug output
** Errors in the JavaScript console **
errors.ts:30 ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[AngularFireAuthGuard -> Router]:
StaticInjectorError(Platform: core)[AngularFireAuthGuard -> Router]:
NullInjectorError: No provider for Router!
NullInjectorError: StaticInjectorError(AppModule)[AngularFireAuthGuard -> Router]:
StaticInjectorError(Platform: core)[AngularFireAuthGuard -> Router]:
NullInjectorError: No provider for Router!
** Output from firebase.database().enableLogging(true); **
N/A (No output)
Expected behavior
User should be navigated to the route /protected.
Actual behavior
User remains on previous route with the JS error complianing about NullInjectorError as a provider wasn't provided for Router.
I have demonstrated this on a StackBlitz Project: https://stackblitz.com/edit/angular-scftvu
Version info
Angular: 8.2.14
Firebase: 7.6.2
AngularFire: 5.3.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): N/A
How to reproduce these conditions
I've captured the issue in a simple project on StackBlitz:
https://stackblitz.com/edit/angular-scftvu
Steps to set up and reproduce
Debug output
** Errors in the JavaScript console **
** Output from
firebase.database().enableLogging(true);**N/A (No output)
Expected behavior
User should be navigated to the route
/protected.Actual behavior
User remains on previous route with the JS error complianing about
NullInjectorErroras a provider wasn't provided forRouter.I have demonstrated this on a StackBlitz Project: https://stackblitz.com/edit/angular-scftvu