Angular Universal Prerender with simple RTDB query never finishes loading
See original GitHub issueWhen running npm run prerender
, the script never finishes loading when trying to prerender a route that has a simple query. Example from my project:
ngOnInit() {
this.afdb.list(path, ref => ref.orderByChild('username').equalTo(username)).query.once('value').then(result => {
console.log(result);
});
}
The output in the terminal stays at “Prerendering 1 routes to …”. However, when I manually stop the script, the file in dist/project/browser will still be rendered correctly, which makes it seem like Universal is waiting for a subscription.
Angular: 11.0.2
Firebase: 8.1.1
AngularFire: 6.1.2
Other (e.g. Ionic/Cordova, Node, browser, operating system):
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
Steps to set up and reproduce
Sample data and security rules
Debug output
** Errors in the JavaScript console **
** Output from firebase.database().enableLogging(true);
**
** Screenshots **
Expected behavior
Actual behavior
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Angular Universal build hangs on prerendering page with ...
Basically if your http requests take too long the prerender hangs and won't finish. Same goes for the websocket connections(firebase uses WS ...
Read more >Prerendering static pages
Angular Universal lets you prerender the pages of your application. Prerendering is the process where a dynamic page is processed at build time...
Read more >Angular Universal: Complete Practical Guide
This post will be a complete practical guide for getting started with Angular Universal. We are going to go start with an existing...
Read more >Angular Universal: Server-Side Rendering and Pre ...
When the client-side application has finished loading, the application switches from the pre-rendered app to the fully interactive client-side ...
Read more >Angular Universal Example: Server Side Rendering (SSR), ...
Angular Universal Example: Server Side Rendering (SSR), Prerender · 1. Getting started with Angular 10 · 2. Routing and HttpClient implementation ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Most likely the Firebase JS SDK is setting up side-effects, a socket or a timer in a weird place, outside of where I am running
zone.runOutsideAngular(() => ...)
. Previously in v8 they surprised me by setting up a timer when the reference is first constructed… I imagine there are other places. I’ll dig in at some point.Ah I thought someone added it to the database calls in the last batch of PRs but I must be misremembering.