Firebase errors on pull of collections and documents.
Get these errors in the browser console.
"Error getting document at path ******: FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore"
and
"Error fetching user data: FirebaseError: Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore"
Had to override firebase with this in the package.json to get it to pull documents from firebase db.
"overrides": { "firebase": "^12.7.0" },
This was opened 6 months ago! Is anyone maintaining this?
Thanks for the report, and sorry it took this long to get an answer.
This is the same problem as #3684, two copies of the firebase SDK installed side by side:
- When a Firestore instance from one copy is passed to the
collection()ordoc()function of the other, the SDK's own type check fails with exactly this message. - In January, installing
@angular/[email protected]next to a firebase 11 produced that dependency tree with no warning. - Your
overridesentry collapsed it back to one copy, which is why it fixed the errors.
AngularFire 21.0.0 handles this for you: ng update @angular/fire@21 moves your firebase dependency to ^12.18.0 and reinstalls, so you can drop the override. If you still see this on 21.0.0 and npm ls firebase shows one firebase version, please open a new issue with that output.
I'm closing this as a duplicate of #3684, where the details live.