ERROR FirebaseError: Expected type '_Query', but it was: a custom _CollectionReference object in 21.0.0-rc.0
- Vorherrschende Sprache
- TypeScript
- Sterne
- 7.8k
- Forks
- 2.2k
- Ø Merge
- 22 Std. 28 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
# 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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, das collectionData-Beispiel auf 21.0.0-rc.0 zu reproduzieren, und untersuche anschließend den onSnapshot-Handler und seine Umwandlung in Query. Als erledigt gilt die Aufgabe, wenn das Abonnement der Collection nicht mehr den FirebaseError für eine CollectionReference auslöst; füge für diesen Fall Tests hinzu oder aktualisiere sie, wenn das Repository einen geeigneten Testort bereitstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- firebase, typescript
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 65/100