AngularFire 7. Get an error when I try to get collection data.

594 views
Skip to first unread message

Vladyslav Hryniuk

unread,
Sep 20, 2023, 9:24:14 AM9/20/23
to Firebase Google Group
Hello,

I try to get all docs from collection following by angular fire documentation.
private firestore = inject(Firestore)

ngOnInit() {
const collectionReference = collection(this.firestore, 'exercises')
collectionData(collectionReference).subscribe(console.log)
}
But get an error in console: 
ERROR FirebaseError: Expected type 'Query', but it was: a custom wh object.

This is my firebase config:
importProvidersFrom([
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideFirestore(() => {
const firestore = getFirestore()
if (environment.useEmulators) {
connectFirestoreEmulator(firestore, 'localhost', 8080)
}
return firestore
}),
provideAuth(() => {
const auth = getAuth()
if (environment.useEmulators) {
connectAuthEmulator(auth, 'http://localhost:9099', {
disableWarnings: true
})
}
return auth
}),
provideStorage(() => {
const storage = getStorage()
if (environment.useEmulators) {
connectStorageEmulator(storage, 'localhost', 9199)
}
return storage
})
]),

Thanks in advance

Jan Heinbokel

unread,
Oct 28, 2023, 11:39:35 AM10/28/23
to Firebase Google Group
Hi,
I am running into the same problem right now. Have you found a solution by any chance?

Thanks!

Reply all
Reply to author
Forward
0 new messages