I don't have login component. I just have an app component and authentication service with the same code which you have written. but I am getting an error in app component in constructor
this.authService.currentUser.subscribe(x => (this.currentUser = x));
i also used
this.authService.currentUserValue().subscribe(x => (this.currentUser = x)); but getting the same error