ERROR FirebaseError: Expected type '_Query', but it was: a custom _CollectionReference object in 21.0.0-rc.0

Author: jakehockey10Created Dec 1, 2025Updated Aug 3, 2026
Labelstype: bugneeds: more infocomp: firestoreversion: current (v17+)

Issue

Upgraded to the release candidate and using the following collection subscription:

typescript
collectionData(collection(firestore, `users/${u.uid}/devices`), {
    idField: 'id',
})

Error

ERROR FirebaseError: Expected type '_Query', but it was: a custom _CollectionReference object

Analysis

Not sure how to provide more detail on this, but it seems to be during a cast to Query in the onSnapshot handler.