I have a function I’ved deployed and scheduled to run every morning into my Google Cloud Functions. It says it runs successfuly and I even see some of the console logs I haven’t taken out yet, but when I look at my firestore collection the data isn’t updated. If I run this same function locally in my Visually Studio code
Tag: google-cloud-functions
How to do CRUD operations on a firestore DB from a cloud function? (Node.js)
I use a cloud function as a webhook receiver, so every time I get a webhook I want to update firestore with some data for example. I don’t get how to use firestore in my clound function. I tried this: All do not seem to be able to initilise this. I also tried: Answer As explained in the documentation, the
Firebase functions using soap finishing with ECONNRESET “socket hang up”
I have a Firebase Function that was running for the last past two years that stopped working without any intervention on my part (no code change nor library update). It is used to retreive data from an external service with soap, parse the data and send it back to a client which is an Android app and now it terminates
React native firebase handling payment flow
I am integrating payment api, I’m using firebase cloud functions as my backend and react-native in frontend, so right now i have the following code: In react-native side: firebase function to handle payment: So the question is, how can I handle long-time response/timeout error/network-loss etc in react-native side, like how should I make it more robust? especially handling long-time responses,
Firebase Cloud Storage – upload with metadata –
I wish to upload files from the browser with metadata that will allow the files to be identified and handled correctly with cloud functions. On the client my uploader code looks like this: And on the server (Firebase Cloud Functions using Node js) The uploadHandler is working – but metadata is undefined, as is metadata.metadata How can I access the
Realtime database cloud function sends result back before finishing
I’m trying to perform some realtime database tasks, which after completion, should send back a result back to the client so the client knows when the tasks have finished. I’ve tried to create a promise due to the fact some realtime database tasks do not return a promise – wasn’t sure which one. Based on the logs, the function completed
React / Stripe / createPortalLink() with firebase v9
I’m using Stripe extension for Firebase with firebase functions. Since I refactored a bit my code for firebase v9 modular SDK, I’m getting the following console error with my Stripe createPortalLink() function: Here is my function: Can anyone please advise? Thanks Answer You need to use the getFunctions() and httpsCallable() functions in the new Modular SDK as shown below: Checkout
Node js Engine not upgrading for firebase function node compatibility
First failed Here is the package.json Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {“node”: 10|12|14|16} Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI. Existing Node.js 8 functions will stop executing at a future date. Update existing functions to Node.js 10 or greater as soon as possible. I
Using async/await inside firebase cloud functions
When performing asynchronous tasks inside a firebase cloud function do I need to await for every task like the example below: or can I just fire these asynchronous calls? given that I don’t need to return anything based on the data received from these tasks to the client like in the other example below: Answer Yes, you need to wait
Firebase Functions Finished with status: error
I am writing my first Firebase Function that is supposed to make a collection with a document inside (in Firestore) when a new user registers. The only logs I am getting are the following: Function execution started and Function execution took 194 ms. Finished with status: error. The versions of the dependencies: This is my code: When I tried outputting