Skip to content

[@nativescript/firebase-firestore] ERROR collectionWithPath #bug #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kakha13 opened this issue Feb 11, 2025 · 0 comments
Open

[@nativescript/firebase-firestore] ERROR collectionWithPath #bug #279

kakha13 opened this issue Feb 11, 2025 · 0 comments

Comments

@kakha13
Copy link

kakha13 commented Feb 11, 2025

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

  1. Initialize Firebase in app.js like this:
    import { firebase } from "@nativescript/firebase-core";
    import "@nativescript/firebase-firestore";
    
    firebase().initializeApp({
       showNotifications: true,
       showNotificationsWhenInForeground: true,
    });
  2. 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,
            });
        });
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant