Skip to content

Angular Universal Prerender with simple RTDB query never finishes loading #2692

@MvRemmerden

Description

@MvRemmerden

When 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions