firebase-tools

Firebase CLI: “Configure as a single-page app (rewrite all urls to /index.html)”

若如初见. 提交于 2019-12-18 04:28:07
问题 I just used the Firebase CLI to init a static hosting project. What exactly happens when you enable the "configure as a single-page app" option? I'm looking for a description of exactly which files are modified, and what kind of effect this has on the Firebase backend. 回答1: That option simply sets a flag in the firebase.json file to redirect all URLs to /index.html . "rewrites": [ { "source": "**", "destination": "/index.html" } ] See the documentation of Firebase Hosting for more information

Firebase API for moving a tree branch from a collection to another one

隐身守侯 提交于 2019-12-13 19:40:44
问题 In my application, I need to move a quite big collection branch to another collection. Currently, I'm using something like that: srcRef .startAt(start) .endAt(end) .once('value', function(snap) { destRef.set(snap.exportVal()); }); Obviously, it is quite expensive, so my question is: Why Firebase does not provide a simple API for that? like: srcRef.moveTo(destRef); 回答1: You can use the Firebase CLI. The Firebase CLI is installed with npm sudo npm install -g firebase-tools Then you can execute

Error: Can't set headers after they are sent in firebase cloud function

只谈情不闲聊 提交于 2019-12-12 10:35:07
问题 I am using Firebase database for my android application. I am using cloud functions feature of it. I have coded functions and trying to test it on local machine. I am running this command to test it, cloud functions works well on firebase server not on localhost. Below commands sends an error firebase serve --only functions > firebase serve --only functions === Serving from 'D:\Firebase'... i functions: Preparing to emulate HTTPS functions. Support for other event types coming soon. Warning:

firebase serve in docker container not visible to host os

你说的曾经没有我的故事 提交于 2019-12-11 02:21:34
问题 Running in a docker container with the ports 9005 available to the host os and when i run firebase serve -p 9005 and then try to access this from the host os (windows) using http://localhost:9005 I get an empty response 回答1: to force firebase serve to be visible you have to specify it to force it to bind to the address 0.0.0.0 otherwise the bind defaults to localhost so you need to run firebase serve -p 9005 -o 0.0.0.0 Make sure that 9005 is exposed and published using the docker command line

Unable to do Firebase deploy - Error: Invalid Firebase specified

余生颓废 提交于 2019-12-10 12:53:57
问题 After accomplishing all the necessary steps on firebase.com/docs and upgrading my app to newer version I still can't run the deploy it using firebase-tools . $ firebase deploy MY_APP_NAME Gives following stack: /usr/local/lib/node_modules/firebase-tools/node_modules/configstore/index.js:53 throw err; ^ Error: EACCES: permission denied, open '/Users/myusername/.config/configstore/update-notifier-firebase-tools.json' You don't have access to this file. at Error (native) at Object.fs.openSync

How to solve TypeError: functions.https.onCall is not a function?

邮差的信 提交于 2019-12-09 20:34:48
问题 I have a Firebase project that I've created earlier this year. It uses Cloud Functions to run some operations on the Realtime Database. Yesterday, I learned about the Callable Cloud Functions, so I decided to try it in my app to see if I should update my existing Functions or not. I've created a simple Cloud Function for testing purposes: exports.testCall = functions.https.onCall((data, context) =>{ console.log(context.auth.uid); return {response:"This means success"}; }); But when I try to

HTTP Error: 401, The entered credentials were incorrect. Firebase Cloud Function

耗尽温柔 提交于 2019-12-09 08:51:17
问题 Whenever I use following command in terminal (mac os sierra) firebase init below three option will be displayed ❯◯ Database: Deploy Firebase Realtime Database Rules ◯ Functions: Configure and deploy Cloud Functions ◯ Hosting: Configure and deploy Firebase Hosting sites If I select nothing and press Enter I will get below message First, let's associate this project directory with a Firebase project. You can create multiple project aliases by running firebase use --add, but for now we'll just

Firebase Functions Deploy Error

ぃ、小莉子 提交于 2019-12-08 11:44:58
问题 I've been working on this project a long time. Deployed this many times. But i opened this project after a month or so and I'm getting the following error after hitting firebase deploy --only functions i deploying functions i functions: ensuring necessary APIs are enabled... i runtimeconfig: ensuring necessary APIs are enabled... ✔ runtimeconfig: all necessary APIs are enabled ✔ functions: all necessary APIs are enabled i functions: preparing functions directory for uploading... Error: Error

How to list all active firebase ci tokens, or revoke them all

大兔子大兔子 提交于 2019-12-08 02:04:37
问题 I realize you can create a firebase token by using firebase login:ci You can revoke an individual token by doing firebase logout --token <token> But how do you either a) revoke all of them, or b) list all the active tokens? I want to make sure there aren't leftover tokens that are still active on a project. 回答1: These tokens are Google OAuth2 refresh tokens (see bullet 4 in Google Identity Platform). Their number is limited (i guess it is 25 ). The easiest way to explicitly revoke a token is

unable to install firebase tools cli using windows 10

余生颓废 提交于 2019-12-07 05:09:50
问题 Hi i unable to install the firebase tools via commandline in the windows im using this below command npm install -g firebase-tools after entering this command i m getting this below error npm ERR! path C:\Users\data\AppData\Roaming\npm\node_modules\firebase-tools\node_modules npm ERR! code ELOOP npm ERR! errno -4067 npm ERR! syscall mkdir npm ERR! ELOOP: too many symbolic links encountered, mkdir 'C:\Users\data\AppData\Roaming\npm\node_modules\firebase-tools\node_modules' npm ERR! A complete