-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Version info
Angular: 11.0.2
Firebase: 8.1.1
AngularFire: 6.1.2
Other (e.g. Ionic/Cordova, Node, browser, operating system): Chrome 87, Windows 10, Angular Universal, Node 12.14.1
How to reproduce these conditions
- Create Angular Universal app with Firebase
- Add Resolver that fetches data from Firestore to a lazy route
- Try navigating to that route in SSR
resolve({params}: ActivatedRouteSnapshot): Observable<any> {
console.log('Resolver');
return this.firestore
.doc(params['id'])
.get()
.pipe(
tap(() => console.log('Resolved')),
catchError(() => this.router.navigate(['']) && EMPTY),
);
}
I also added console.log('Constructor')
in that route's component constructor.
Debug output
Console logs print out correctly:
Resolver
Resolved
Constructor
Expected behavior
Route opens with resolved data
Actual behavior
Route is stuck on loading, server does not return the page
Here comes the weird part
There's a very strange way to kick-start it :)
- Replace
doc
withcollection
in Resolver - Add some other request to Firestore in route's component (doesn't matter
doc
orcollection
) - Use
async
pipe in template to show that new request's result
I'm very confused.
It's hard to provide a reproduction, because it's SSR. I'll be happy to show it in my app if somebody is willing to live chat, it's pretty straightforward.
Marcusg62, comeacross1989 and SangarlloMarcusg62, comeacross1989 and axelforstiMarcusg62, comeacross1989 and Sangarllo