firebase-tools

How do import data from cloud firestore to the local emulator?

主宰稳场 提交于 2020-05-16 13:55:26
问题 I want to be able to run cloud functions locally and debug against a copy from the production data. Is there a way to copy the data that is online to the local firestore emulator? 回答1: You can use the firestore-backup-restore to export and import your production data as JSON files. I wrote a quick hack to allow for importing these JSON in the Firebase Simulator Firestore instance. I proposed a pull request and made this npm module in the meantime. You can use it this way: const

How do import data from cloud firestore to the local emulator?

久未见 提交于 2020-05-16 13:54:13
问题 I want to be able to run cloud functions locally and debug against a copy from the production data. Is there a way to copy the data that is online to the local firestore emulator? 回答1: You can use the firestore-backup-restore to export and import your production data as JSON files. I wrote a quick hack to allow for importing these JSON in the Firebase Simulator Firestore instance. I proposed a pull request and made this npm module in the meantime. You can use it this way: const

Firebase emulator return empty data whereas working fine after deploying

北城余情 提交于 2020-05-15 08:08:13
问题 I have a written a very basic API which will return the services. I tried to run this API in emulator but it return the empty data { "status": "success", "statusCode": 200, "message": "Services retrieved", "data": [] } I have setup the firestore, functions and database emulators. And I am using "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.0" Any idea why the data response is empty ? EDIT This is my method to call the service export const activeServices = functions.https.onRequest(

Firebase emulator return empty data whereas working fine after deploying

こ雲淡風輕ζ 提交于 2020-05-15 08:06:59
问题 I have a written a very basic API which will return the services. I tried to run this API in emulator but it return the empty data { "status": "success", "statusCode": 200, "message": "Services retrieved", "data": [] } I have setup the firestore, functions and database emulators. And I am using "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.0" Any idea why the data response is empty ? EDIT This is my method to call the service export const activeServices = functions.https.onRequest(

Firebase tools: login as service account

爷,独闯天下 提交于 2020-03-21 19:06:05
问题 I cannot find way how to deploy firebase project (functions) on behalf of service account. Nothing is said both on documentation page and also I found nothing related in their bug tracker. As described, I run firebase login:ci command but then I need to login myself - and I want login as service account. Such feature is available using gcloud tool, but, as stated in docs, Cloud Functions written using the Firebase SDK for Cloud Functions can't be deployed using the gcloud command-line tool,

Firebase tools: login as service account

我只是一个虾纸丫 提交于 2020-03-21 19:05:34
问题 I cannot find way how to deploy firebase project (functions) on behalf of service account. Nothing is said both on documentation page and also I found nothing related in their bug tracker. As described, I run firebase login:ci command but then I need to login myself - and I want login as service account. Such feature is available using gcloud tool, but, as stated in docs, Cloud Functions written using the Firebase SDK for Cloud Functions can't be deployed using the gcloud command-line tool,

firebase-tools “Error: certificate has expired”

你离开我真会死。 提交于 2020-02-27 14:09:13
问题 This morning I tried to deploy my react project to firebase hosting but I received this error: Error: Server Error. certificate has expired Then I tried to execute firebase list command to see the list of my projects but again I received the same error! I tried it on other projects with the same result. So I believe this error is not related to a specific project and it has something to do with firebase-tools . Here is the error log: [debug] [debug] [2020-01-07T03:37:57.789Z] > command

How to configure timeout of Firebase functions on local

折月煮酒 提交于 2020-01-13 10:27:17
问题 I want to do some intense job on firebase functions and it usually takes more than 60 seconds. On production, I can set timeout longer from web console but I cannot find setting for local environment. Following is the command which I'm using to start serving. firebase serve --only functions I'm using HTTPS trigger and following is the command to trigger my function on local. functions-emulator call myfunc --data='{"uid":"user_id_1"}' Is there way to configure timeout on local? 回答1: You can

firebase-tools error: EACCES: permission denied

佐手、 提交于 2020-01-11 07:13:12
问题 I am trying to deploy Firebase hosting of my web app. At the command line, when I type firebase deploy , I get the following error. Note: firebase deploy is just one example. The same error occurs for all firebase commands. (e.g., firebase --help , firebase -v , firebase login , firebase logout , etc.) Error /usr/local/lib/node_modules/firebase-tools/node_modules/configstore/index.js:53 throw err; ^ Error: EACCES: permission denied, open '/Users/mowzer/.config/configstore/update-notifier

Google Cloud Functions Cron Job Not Working

风格不统一 提交于 2019-12-24 19:49:36
问题 I am trying to set up a scheduled function in Firebase Cloud Functions. As a simple test, I have tried to recreate the sample shown on the documentation page: const functions = require('firebase-functions') exports.scheduledFunction = functions.pubsub .schedule('every 5 minutes') .onRun(context => { console.log('This will be run every 5 minutes!') return null }) However, when I run firebase serve --only functions , I get the following error: function ignored because the pubsub emulator does