angular/angularfire

Pagination with startAfter : Hn is not a function or its return value is not iterable

alhendi99 opened this issue · 1 comments

I am working on an Angular application using the following versions:
@angular/fire: 7.5.0
@angular/core: 15.2.0
firebase: 9.17.1 Node.js: v20.11.1

I am implementing pagination for a Firestore query using startAfter with lastVisible, which is expected to be a DocumentSnapshot. While the logic works in most cases, i get this error:

TypeError: Hn is not a function or its return value is not iterable
    at index.esm2017.js:19940:33
    at Ul (index.esm2017.js:19951:5)
    at $l._apply (index.esm2017.js:19876:19)
    at Rl (index.esm2017.js:19608:30)
    at angular-fire.js:227:48
    at angular-fire.js:160:59
    at _ZoneDelegate.invoke (zone.js:372:26)
    at Zone.run (zone.js:134:43)
    at NgZone.runOutsideAngular (core.mjs:24159:28)
    at runOutsideAngular (angular-fire.js:160:35)
Here is the code I used for pagination:
queryRef = query(
    collection(this.firestore.firestore, "Inventory_Transfers"),
    where("is_deleted", "==", false),
    where("restaurant_id", "==", restaurantId),
    where("status_by_portal_tab", "==", statusByPortalTab),
    where("requester_type", "==", requesterType),
    where("branch_ids_requested_for", "array-contains-any", batch),
    orderBy("create_on", "desc"),
    startAfter(lastVisible),
    limit(batchSize)
);

This issue does not seem to follow the issue template. Make sure you provide all the required information.