angular / angular/angularfire

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

Open
#3,684 10 comments 10 reactions 0 assignees View on GitHub
comp: firestore needs: more info type: bug version: current (v17+)
Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
22h 28m
Merged PRs (30d)
6

Description

# 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.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the collectionData example on 21.0.0-rc.0, then inspect the onSnapshot handler and its cast to Query. Done means the collection subscription no longer raises the FirebaseError for a CollectionReference; add or update coverage for this case if the repository exposes a relevant test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, typescript
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.