【发布时间】:2020-07-21 15:58:39
【问题描述】:
我在尝试访问 Firestore 集合时不断收到此错误
这是我的 Firebase 配置
import Firebase from "firebase";
import "firebase/auth";
import "firebase/firestore";
let config = {
apiKey: "xxx",
authDomain: "xxx.firebaseapp.com",
databaseURL: "https://xxx.firebaseio.com",
projectId: "xxx",
storageBucket: "xxx.appspot.com",
messagingSenderId: "xxx",
};
let fb = Firebase.initializeApp(config);
let firestore = fb.firestore();
export const db = firestore;
export const auth = fb.auth();
export const firebase = fb;
组件中的导入和使用:
import { db } from "./src/plugins/firebase";
db.collection("collection")
.doc(docId)
.collection("subcollection")
.doc(subdocId).set({
some object
})
我在Type Error undefined is not an object (evaluating 'Wu.getRandomValues')中看到过类似的问题
所以我将 firebase 降级到 7.9.0 但它没有修复它...
这仅在使用选项--dev false 运行 react-native 捆绑包时才会发生,如果 --dev true 我没有收到错误...
【问题讨论】:
标签: firebase react-native google-cloud-firestore