Error: 'canActivate' in type 'AuthGuard' is not assignable to the same property #3010
Unanswered
rulaman123
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I import compat or modular auth guard I get this error while compiling:
{ "message": "\u001b[96mnode_modules/@angular/fire/auth-guard/auth-guard.d.ts\u001b[0m:\u001b[93m13\u001b[0m:\u001b[93m5\u001b[0m - \u001b[91merror\u001b[0m\u001b[90m TS2416: \u001b[0mProperty 'canActivate' in type 'AuthGuard' is not assignable to the same property in base type 'CanActivate'.\r\n Type '(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<boolean | UrlTree>' is not assignable to type '(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => boolean | UrlTree | Observable<boolean | UrlTree> | Promise<...>'.\r\n Type 'Observable<boolean | UrlTree>' is not assignable to type 'boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree>'.\r\n Type 'Observable<boolean | UrlTree>' is missing the following properties from type 'Observable<boolean | UrlTree>': _isScalar, _trySubscribe, _subscribe\r\n\r\n\u001b[7m13\u001b[0m canActivate: (next: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<boolean | import(\"@angular/router\").UrlTree>;\r\n\u001b[7m \u001b[0m \u001b[91m ~~~~~~~~~~~\u001b[0m\r\n" }
Using angular 12.1.1, angularFire 7.1.0, firebase 9.1.2, rxFire 6.0.2 and rxJS 6.6.7.
With angularFire 7.0.4 compat auth guard was working fine.
Edit: Don't know why but the problem is fixed with angularFire 7.1.1.
Beta Was this translation helpful? Give feedback.
All reactions