I am facing an issue in my angular page that sometimes my page is not loading. I have enabled tracing in routes and observed that in NavigationCancel event, it throws an error reason:
My route resolver is given below
@Injectable()
export class MyResolver implements Resolve<any> {
constructor(...) { }
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const newPath = doSomeStuff()
this.router.navigateByUrl(newPath)
}
}
I suspect because I am not returning any stuff and redirecting to new path, the resolver is not emitting any value and hence this issue occurs. Please also note that other resolvers are properly emitting and I dont see any issues in that. Any suggestions how to overcome from this issue? Happy to share if any further details required.