NativeScript / NativeScript/firebase

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

Đang mở
#279 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
62
Fork
53
Merge trung bình
8 ngày 4 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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,
            });
        });
    });

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với việc khởi tạo trong app.js và lệnh gọi Firestore trong Users.vue, sử dụng các package NativeScript-Vue và @nativescript/firebase đã được báo cáo làm ngữ cảnh tái hiện. So sánh hành vi khi việc khởi tạo được đặt trong App.vue, sau đó xác minh rằng việc lấy collection users hoạt động từ Users.vue khi vẫn giữ việc khởi tạo trong app.js.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
firebase, typescript
Lĩnh vực
database, mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.