Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alhendi99 opened this issue Dec 23, 2024 · 1 comment

Comments

@alhendi99
Copy link

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)
);
@google-oss-bot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants