I've been working on a project involving Firebase and Firebase functions. Right now, I'm struggling to retrieve documents from a collection called 'items'. When I try to make a GET request, all I get is a 200 status code with an empty r ...
Trying to figure out how to integrate a Firestore trigger written in an external JavaScript file (notifyNewMessage.js) into my TypeScript file (index.ts) using Node.js for Cloud functions. Both files are located in the same directory: https://i.stack.imgu ...
Looking for some assistance with this coding issue, hoping someone with expertise can lend a hand! (Not my forte) I've written this Typescript code snippet for a basic CloudFunction export const add2list = functions.https.onRequest((req:any , res:any ...
Currently, I am utilizing a Firebase serverless function to store my leads. I have the belief that Firebase leverages the request object from express.js. Consequently, I've included my code below: export const addLead = functions .https.onRequest(async ...
We've successfully implemented code that triggers emails to a user and their contacts whenever a new node is added to a specific path in Firebase's realtime database. Currently, the average time taken to send these emails is approximately 4 minu ...
I currently have two triggers set up in my Firebase functions: user onUpdate owner onUpdate When the owner onUpdate trigger is activated, it performs an operation and updates the user document accordingly. The user onUpdate trigger is invoked by the pr ...
While working with Typescript on firebase functions, I have encountered challenges in testing and experimenting with the code. Despite using the Lint plugin to identify errors without running the code, I am struggling to run the code and view the output. ...
I am currently experiencing performance issues with a simple Cloud Function in Firebase. This function is responsible for taking JSON data through an HTTP POST request and storing it in a Firestore collection. Despite being assigned 512MB of memory, the pe ...
I attempted to run the initial example from the Cloud Functions Documentation. I went ahead and created my function, then simply copied and pasted the example code provided in the docs. Correction: Instead of using the original example, I took the code sn ...
Currently in the process of upgrading my Travis environment to node 20, where I am running a script that deploys Firebase functions. Below is my .travis.yml file: ... install: bash $HOME/build/ChangEdApps/changed-javascript/backend/shellScripts/travis-scr ...
I encountered an issue in my firebase functions project with typescript. The problem arises when I use types from outside the project with sub path imports, causing the build files to become distorted. Instead of having main:lib/index.js, I have main:lib/ ...
Every time I try to run firebase deploy, an error pops up while parsing my function triggers. It specifically points to this line of code: import * as functions from 'firebase-functions'; at the beginning of my file. This is a new problem for me ...
Exploring ways to enhance cold start times for my Firebase functions led me to discover an article that focused on maximizing performance and readability using TypeScript with the base usage of the http onRequest function. However, I was eager to implement ...
I am looking to incorporate routing within my Express application, which will be exposed through a cloud function. Here is the content of my functions/index.js file : const functions = require('firebase-functions'); const express = require('express'); co ...
When deploying database, storage, Firestore, functions, and hosting, you may encounter an error like the following: Running command: npm --prefix $RESOURCE_DIR run lint npm ERR! path D:\public\$RESOURCE_DIR\package.json npm ERR! code ENOENT ...
Below is a Firebase cloud function I have created that can be accessed through a REST API. My aim is to save the user-submitted values from the front end via the 'Web service URL': 1.) The data should be stored in the Firebase-realtime database. 2.) I c ...
My current project involves designing my firebase database with a unique approach. I am looking to establish a connection between certain document fields in firestore and real-time database fields. This way, any changes made in the real-time database will ...
I am facing an issue with my monorepo setup where my cloud functions are importing from another package within the workspace. The imported package is listed in the package.json under devDependencies as shown below: // stuff "dependencies": { &q ...
Currently, I have a Firebase cloud function that utilizes express middleware to generate an authToken and passes it through the routes. This token has a 24-hour lifespan, so to avoid overloading the service with excessive requests, I am looking to cache th ...
I'm working with Google Cloud Functions that require a JSON key file. Here is an example: const SERVICE_ACCOUNT_EMAIL = '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="41382e34331e322433372822241e2022222e342f351e242 ...
Is it possible to split a large index.js file into multiple files in order to better organize the code? Specifically, can Firebase triggers be written in separate JavaScript files? If so, could you please provide guidance on how to do this properly? child. ...
After creating Firebase functions to send notifications on data changes in Firestore, I encountered a problem when trying to transfer the code from my old computer to a new one. The commands are now throwing errors and I have been attempting to fix them fo ...
I'm experiencing a strange issue with Firebase functions that seems to be specific to mobile devices and only occurs immediately after a user logs in for the first time (refreshing the page resolves the issue). Here is the code snippet: const functions = ...
Objective I aim to gain a deeper understanding of how the firebase CLI manages the deployment process for multiple firebase functions, each stored in different files, and how it handles dependencies that are specific to certain functions. Situation If I ...
I have created a firebase-function that is scheduled to retrieve data from an external API source and save it in Firestore. const functions = require("firebase-functions"); const admin = require("firebase-admin"); const { default: Axios ...
I am exploring the option of writing a cloud function to download a video file. Below is an example of how I plan to save the file in mp4 format: const http = require('http'); const fs = require('fs'); const file = fs.createWriteStream ...
Whenever I attempt to deploy my Firebase cloud functions, I encounter the following error. Expected outcome: Successful deployment of functions. Error: Error: An issue occurred while reading functions/package.json: functions/lib/index.js is missing and ...
I've been working on setting up an Angular Universal project and encountered an issue when trying to deploy it. After successfully compiling it with npm run build:ssr, I faced errors while deploying using firebase deploy. === Deploying to 'terabu ...
Recently, I created a Firebase cloud function where my goal is to access every user's internal collection named 'numbers' and examine each document within that collection for some comparisons. Do you have any insights on how I can achieve this? Despite b ...
I am currently working on deploying an API for my application. However, when using the following code snippet, I encountered an unhandled error stating "Error: Data cannot be encoded in JSON." const functions = require("firebase-functions"); const axios = ...
Written below is the code responsible for triggering a change in the real-time database: const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); expor ...
In my cloud function, I have set up a trigger that activates on document write. This function is designed to check multiple documents based on the trigger and execute if/else statements accordingly. I have developed a method that retrieves all documents u ...
I am working with a Firebase (Google) cloud function that is structured like this // Initialize the Auth0 client var AuthenticationClient = require('auth0').AuthenticationClient; var auth0 = new AuthenticationClient({ domain: 'familybank.auth0.c ...
I am experiencing issues with my Cloud Function which is supposed to call a request to the URL passed to it. This is my first time using TypeScript to make a request, so I added some print calls to troubleshoot the problem. However, the first log never app ...
While working with Firebase Functions, I encountered an issue when attempting to install and use axios. Despite using npm install to add the package as shown below, the installation failed without any clear indication of what went wrong during runtime. Co ...
When trying to retrieve my data from firestore using an HTTP get request, I encountered an error. It might be helpful if my data in firestore was stored in JSON format. I'm not sure if this is feasible. <!DOCTYPE html> <html lang="en"> < ...
Encountering a challenge while using Express middleware with Firebase Functions. In this sample, a function is linked to the app() instance as shown below: app.get('*', (req, res) => { res.send(`Hello ${req.user.name}`); }); exports.authorizedHello ...
Is it possible to query cloud storage using the external table concept in Node.js? I found some code in Python that achieves this functionality, but I would prefer to implement the same logic in Node.js. Is there a way to do this? ...
I'm currently attempting to utilize a Google Cloud function to convert a 3D model into an image. However, my function is failing to deploy. I have made attempts using both `ypm install` and `npm install` in the package file. Deployment error: Build failed ...
Is it possible to run a function when there is a change in either a document within the parent collection or a document within one of its subcollections? I have tried using the code provided in the Firebase documentation, but it only triggers when a docume ...
So, here's my idea: to improve the search engine optimization (SEO) of my Single Page Application (SPA), I plan on detecting web crawlers on the server side using headers. If a crawler is detected, I want to render the page with Puppeteer and return it acc ...
I'm currently working on incorporating Firebase functions in my index.ts file: import * as functions from "firebase-functions"; export const helloWorld = functions.https.onRequest((request, response) => { functions.logger.info("Greet ...
Whenever I run firebase deploy, firebase deploy --only functions, or firebase deploy --only functions:functionName, I keep receiving the dreaded message: Error: An unexpected error has occurred. Please do not flag this as a duplicate question, as I have th ...
I am encountering an issue while trying to deploy my Firebase Cloud Function using the following command: firebase deploy --only functions:helloWorld Although the command succeeds occasionally, most of the time it fails with the error mentioned above. Wha ...
Currently, I am utilizing React along with next.js and Google Cloud functions to host my application. Additionally, I am integrating firebase into the mix. One pressing issue I am facing pertains to efficiently configuring the staging and production enviro ...
Can anyone help me understand how to extract information from an object received through an HTTP POST request? Below is the code I am using: this.http.post(url, user, httpOptions).subscribe(result => { console.log(result.status); }); The issue aris ...
Having an issue with my Firebase function that triggers on a Stripe webhook via express. The function itself runs smoothly, but I keep encountering an error when trying to send an email (using Axios): Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after ...
Using the firebase resize extension to automatically create resized pictures, such as turning user1profile into user1profile_320x320. A trigger function is in place to update documents in firestore once the thumbnail is generated: const isThumbna ...
My index.js file has a dependency on Cloud Tasks: const {CloudTasksClient} = require("@google-cloud/tasks"). However, when attempting to deploy my cloud function using Tasks, I encountered the error: Detailed stack trace: Error: Cannot find module '@g ...
I'm interested in creating a cloud function that can be executed from both the client and the backend. After exploring the documentation, I learned that an HTTPS callable function will automatically include user authentication data, accessible through the ...
As someone diving into the world of Google cloud functions and Node.js, I've found myself accumulating quite a lengthy Index.js file due to all the functions I've had to write. I'm curious if there's a way for me to allocate each function to its own sepa ...
I'm currently working on setting up a sendgrid designated URL at www.mydomain.com/mail/post. My goal is to create a Google Cloud Function that will respond to emails coming in from the inbound parse API. However, I'm facing issues with triggering the API w ...
I'm currently facing a challenge while coding a Google Cloud Function using TypeScript. The concept involves having handler functions defined for various Cloud Functions in separate files within the source repository, along with some code that is shar ...
I've encountered an issue while trying to build an API with the NextJs framework and hosting it on Firebase (Hosting and Functions). The GET requests work fine, but when I try to send a POST request, I keep getting a "502 Bad Gateway" error. To replicate ...
Encountering an issue with my project involving Node.js and Firebase. My goal is to implement an admin role by utilizing custom claims as outlined in the documentation. Within the cloud functions, I have three specific functions: exports.addAdminRole = fun ...
As I was upgrading my firebase-tools from version 8.6.0 to 8.7.0 using the command sudo npm i -g firebase-tools within my functions folder, I encountered the following warnings: npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email ...
Hey there, I have a simple Express setup on Firebase, shown below: import { onRequest } from 'firebase-functions/v2/https'; import express from 'express'; import bodyParser from 'body-parser'; import router from './router.js'; import cors from 'cors'; co ...
I am facing an issue with triggering a Cloud Function using the Cloud Firestore trigger. The function is supposed to perform a full export of my sub collection 'reviews' every time a new document is added to it. Despite deploying the function successfully ...
Currently, I am in the process of creating a Firebase function using TypeScript to deliver push notifications to multiple users. However, whenever I execute the command firebase deploy --only functions, TSLint flags an error stating "Promises must be han ...
As someone new to Node.js, Firebase Cloud Functions, and TypeScript, my objective is to create a cloud function that acts as an HTTP endpoint for clients to authenticate with Firebase. The desired outcome is for the cloud function to provide a custom acces ...
I have integrated a Firebase Cloud Function with ExpressJS that I want to access from my mobile application. Instead of making a simple http request, I am considering using the cloud_firestore package in Dart/Flutter as it may handle authentication more s ...
My objective is to make a request to a Cloud Function, receive a response with a Set-Cookie header, and have the browser store the cookie. The issue arises when the response containing a Set-Cookie header is ignored without the presence of withCredentials ...
I have developed a unique platform that allows fitness coaches to effectively communicate and share workout plans with their clients. However, I am looking to further enhance this platform by introducing a new feature: the ability for coaches to configure ...
I am facing an issue with this function that is supposed to add new users to my firebase database, but for some reason, it's not working. exports.createUserWithEmailAndPassword = functions.https.onCall( async(data, context) => { const { admi ...
I'm encountering an error while trying to update my firebase functions: C:UsersMYNameAppDataRoaming pm ode_modulesfirebase-tools ode_modules@grpcgrpc-jsuildsrcindex.js:47 throw new Error(`@grpc/grpc-js only works on Node ${supportedN ...
Currently, I am working on developing a function for firebase that will trigger a POST request to call a specific URL. While I have successfully implemented GET requests, tackling the POST method has proven to be more challenging. I have some sample code ...
Consider this scenario: I have a dynamic filter list for my product list, and I want to send an HTTPS request to a cloud function based on the selected filters. However, when trying to set multiple conditional where clauses from that request... The multip ...
Looking to set up a cron job or scheduler that runs every 30 minutes following an onCreate event in Firestore. The goal is to execute a cloud function that retrieves documents created within the last 30 minutes, validates them against a JSON schema, and ...
My Firebase Cloud Functions setup looks like this: index.js const functions = require('firebase-functions'); const trackVote = require('./trackVote') const admin = require('firebase-admin'); admin.initializeApp(); exports.trackVote = trackVote.handler; ...
I am currently working on my first Google Cloud Function and I have limited knowledge about it. My goal is to create a Google Cloud Function integrated with Twilio. Whenever the water level changes in my Realtime Database, I want to send an SMS to a specif ...
I have successfully implemented the following function on my node.js localhost: // index.js const scrape = require('website-scraper'); const PuppeteerPlugin = require('website-scraper-puppeteer'); const path = require('path'); ...
I am facing an issue where I cannot retrieve the original message I sent from an "https.onRequest" function in Firebase. The firebase client is rewriting the message based on the error code, making it difficult for me to recover the originally sent body or ...
When I run firebase deploy, it runs for a few minutes before giving me a timeout error Error: ESOCKETTIMEDOUT I have successfully deployed multiple times before, without making any changes other than the frontend of my React project. My cloud functions i ...
I encountered the following error message: Error: No response has been set. Is this being used in an async call that was not returned as a promise to the intent handler? at DialogflowConversation.response (/user_code/node_modules/actions-on-google/dis ...
When I'm listening on a local port with my browser, the following method will return Hello world. //Node app.get('/', (req,res)=>{ res.send('Hello world') }); I've successfully exported the app as a ca ...