我已经成功地运行了Firebase模拟器:
E:\firebase>firebase emulators:start
i emulators: Starting emulators: functions, firestore
! Your requested "node" version "8" doesn't match your global version "10"
+ functions: Emulator started at http://localhost:5001
! No Firestore rules f
我有一个小的测试文件,试图使用管理sdk获取一个firestore文档。我一直收到错误TypeError: admin.firestore(...).collection(...).doc(...).then is not a function
我在本地服务/测试。我做错了什么?
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp({
credential: admin.credential.
我正在尝试获得一个简单的原子增加/减少工作在Firebase云函数与Firestore触发器。为了测试这些,我想使用Firestore仿真器执行本地测试。
但我总是收到错误FirebaseError: Function DocumentReference.update() called with invalid data. Unsupported field value: a custom object (found in field myfield)
我的代码很简单,如下所示
import * as functions from 'firebase-functions';
i
我正在尝试使用Firebase Firestore的文档快照侦听器。我希望根据来自服务器的当前文档值执行一些操作,但也要侦听文档的更改,并在可能的情况下启用脱机缓存。 侦听器在文档发生更改时更新状态,但由于某种原因,它总是在侦听时更改内容的先前缓存中进行操作: let unsub = firebase.firestore().collection('myCol').doc('myDoc').onSnapshot((doc) => {
if(doc.data().myVal) myFunction(); //myVal is always what
编辑:我刚刚意识到,即使在一个简单的屏幕上使用APPBAR,它也会发生。
[Fatal Error] firebase-firestore-22.1.2.pom:2:1: Content is not allowed in prolog.
[Fatal Error] firebase-firestore-22.1.2.pom:2:1: Content is not allowed in prolog.
[Fatal Error] firebase-firestore-22.1.2.pom:2:1: Content is not allowed in prolog.
[Fatal Error]
我正在构建一个棱角分明的web应用程序,我是这样导入的:
import * as firebase from 'firebase';
db = firebase.firestore();
但是最近我不断地发现这个错误:
It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import the
individual SDK components