firebase-cli

Can't test cloud functions locally, emulator fails to start with TypeError: _onRequestWithOpts is not a function

放肆的年华 提交于 2019-12-05 00:41:29
When I try to start the shell for local testing from the functions directory in my project, the emulator starts but my functions are not able to be loaded. When I run "npm run build" I receive no errors. What is happening? I have tried removing the functions directory and creating it again using the firebase-tools cli but I still get the same error. I have also exported the admin credentials. I'm using the default method created in the index.ts file generated from the firebase-tools cli. import * as functions from 'firebase-functions'; import * as admin from 'firebase-admin'; admin

ESLint error while trying to deploy firebase functions

送分小仙女□ 提交于 2019-12-04 17:29:25
问题 I tried deploying a firebase functions but it keeps failing due to some issue with ESLint. I have also tried googling the answer but everything I am seeing is all Greek to me. I have also stumbled on this and this answer but it appears they're not applicable to my scenario. My Function // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase-functions // // exports.helloWorld = functions.https.onRequest((request, response) => { //

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

社会主义新天地 提交于 2019-12-04 15:37:27
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 deploy this function, I get the error: Error: Error occurred while parsing your function triggers.

Testing callable cloud functions with the Firebase CLI shell

岁酱吖の 提交于 2019-12-03 17:19:36
问题 I have been trying new firebase callable cloud functions in firebase functions:shell I keep on getting following error Request has incorrect Content-Type. and RESPONSE RECEIVED FROM FUNCTION: 400, {"error":{"status":"INVALID_ARGUMENT","message":"Bad Request"}} Here is ho w I am trying to call this function on shell myFunc.post(dataObject) I have also tried this myFunc.post().form(dataObject) But then I get wrong encoding(form) error. dataObject is valid JSON. Update: I figured that I need to

ESLint error while trying to deploy firebase functions

好久不见. 提交于 2019-12-03 11:32:33
I tried deploying a firebase functions but it keeps failing due to some issue with ESLint. I have also tried googling the answer but everything I am seeing is all Greek to me. I have also stumbled on this and this answer but it appears they're not applicable to my scenario. My Function // // Create and Deploy Your First Cloud Functions // // https://firebase.google.com/docs/functions/write-firebase-functions // // exports.helloWorld = functions.https.onRequest((request, response) => { // response.send("Hello from Firebase!"); // }); //import firebase functions modules const functions = require

TypeError: Cannot read property 'wanted' of undefined:

喜你入骨 提交于 2019-12-03 09:52:21
I have been deploying functions with firebase successfully all day learning how to use it. I was trying to see what happened if I initialized another directory that deploys to the same project and had no problems until i updated my npm version and now I am getting "Unexpected error has occurred" whenever I try to deploy I have tried updating npm permission by making my own user the owner of the node_modules, bin, and share directories. I have tried uninstalling and reinstalling firebase-tools. I have also tried deleting all my current function directories and initializing a fresh directory and

Unable to change location for firebase pubsub trigger

◇◆丶佛笑我妖孽 提交于 2019-12-02 17:38:21
问题 I have an App Engine app in asia-northeast1, but i could not specify the region for pubsub trigger. This works: functions.region("asia-northeast1").https.onRequest(async (req, res) This does not work: functions.region("asia-northeast1").pubsub.schedule('* 6-23 * * *') With the following erroor message: Error: HTTP Error: 400, Location must equal asia-northeast1 because the App Engine app that is associated with this project is located in asia-northeast1 Does anyone have any experience getting

Unable to change location for firebase pubsub trigger

被刻印的时光 ゝ 提交于 2019-12-02 10:26:07
I have an App Engine app in asia-northeast1, but i could not specify the region for pubsub trigger. This works: functions.region("asia-northeast1").https.onRequest(async (req, res) This does not work: functions.region("asia-northeast1").pubsub.schedule('* 6-23 * * *') With the following erroor message: Error: HTTP Error: 400, Location must equal asia-northeast1 because the App Engine app that is associated with this project is located in asia-northeast1 Does anyone have any experience getting pubsub trigger to work in a different region than the default us-central1? Thank you in advance This

firebase cli serve cant access the project from different device

一笑奈何 提交于 2019-12-01 05:16:59
问题 I have install firebase cli etcetc. I can start the project and develop using firebase serve. I can visit the page of the project through localhost:5000 but if i try from different device in my network (mobile phone) to access network-ip:5000 I get connection refused. Anyone knows what configuration/command it needs to forward port 5000 ? (different projects like creat-react-app works fine) 回答1: firebase serve -o 0.0.0.0 The -o flag sets the host. For more information, see Server Fault: What

Firebase Serve command failing with error 404

家住魔仙堡 提交于 2019-11-30 09:02:33
Whenever I run firebase serve on my mac I am getting a 404 error...This has never happened before and I was just using the local dev server maybe 5 minutes before this started happening. I have deleted the firebase.json file and reinitialized it, reinstalled firebase tools but it fails every time. Here are the results from running the command in debug mode. firebase serve --debug [2018-09-11T16:12:25.873Z] ---------------------------------------------------------------------- [2018-09-11T16:12:25.876Z] Command: /usr/local/bin/node /usr/local/bin/firebase serve --debug [2018-09-11T16:12:25.877Z