[@nativescript/firebase-firestore] ERROR collectionWithPath #bug
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- firebase, typescript
- Domain
- database, mobile-dev
Research direction
Start with the initialization in app.js and the Firestore call in Users.vue, using the reported NativeScript-Vue and @nativescript/firebase packages as the reproduction context. Compare the behavior when initialization is placed in App.vue, then verify that fetching the users collection works from Users.vue with initialization kept in app.js.
Written by the indexing model from the issue text.
Description
Bug Report: Cannot read properties of undefined (reading 'collectionWithPath') in Firebase Firestore
Description
When trying to fetch data from Firestore using firebase().firestore().collection("users"), the following error occurs:
However, initializing Firebase in App.vue instead of app.js resolves the issue.
Environment
- NativeScript-Vue:
3.0.0-rc.2 - @nativescript/firebase-firestore:
3.4.0-alpha.1 - Platform: (e.g., Android, iOS)
Steps to Reproduce
- Initialize Firebase in
app.jslike this:import { firebase } from "@nativescript/firebase-core"; import "@nativescript/firebase-firestore"; firebase().initializeApp({ showNotifications: true, showNotificationsWhenInForeground: true, }); - Fetch Firestore data in Users.vue
firebase()
.firestore()
.collection("users")
.orderBy("points", "desc")
.where("points", ">", 0)
.get()
.then((querySnapshot) => {
querySnapshot.forEach((documentSnapshot) => {
users.push({
...documentSnapshot.data(),
id: documentSnapshot.id,
});
});
});
- Dominant language
- TypeScript
- Stars
- 62
- Forks
- 53
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NativeScript/firebase
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
NativeScript/firebase#292 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
NativeScript/firebase#289 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NativeScript/firebase#288 · 4 reactions ·
-
bug ios
NativeScript/firebase#287 · 1 assignee ·
-
Uh-Oh Shazam Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
NativeScript/firebase#286 ·
All issues in NativeScript/firebase
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100