I am trying to make 2 fetch requests inside a function which runs periodically. However, I keep on getting this error. Answer Cloud Functions run in a nodejs JavaScript environment. This is very different than browser JavaScript environments. You won’t have access to the fetch() function that browsers provide – that explains the error message. What you will need to
Tag: firebase
Firebase function deploy fails with requiring external code
I am trying to re-use existing Express application and basically port it to firebase functions. I have a project structure like this: /src/app/index.js /functions/index.js The whole set up works well when using firebase emulators:start. I can call the functions and everything works properly. However I am unable to deploy the functions as I get this error message: Function failed on
Firebase.auth().useEmulator is not a function
I currently have a project set up through VueCLI and firebase-tools and can’t seem to be able to attach the Firebase Auth emulator to my project locally. My Firebase Set-up file: My .env.development file When navigating to localhost:5000 (emulated hosting), I get the error: Uncaught TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_0___default.a.auth(…).useEmulator is not a function useEmulator comes directly from Google’s Firebase Documentation so I’m
Send confirmation e-mail to client on saving data to firestore
I am trying to make a website for taking online bookings. The site has been hosted in firebase and I am using firestore to collect the details of booking. I am using the code given below to collect the details in firestore. Now the problem is, I would like to send email to my client and get a email at
How to add data to a nested object in Firestore
This is my current Firestore in Firebase. I need help adding data to the savedSearches map. I need to use .set() (because a users savedSearches might not exist). My current attempt looks like this: But this doesn’t add an object within savedSearches with a unique ID. When I was using Firebase Realtime Database I was just doing this: And that
Firebase Cloud Function listUser get 1000+ users
I want to modify the database value that has the uid of all users as the key after getting uid through listUser(), but listUser() has 1000 max. If there is a good way to get uid of all users, please let me know Answer The Firebase Admin SDK supports pagination to cycle through all the registered user accounts. Follow the
Firebase Realtime Database, only send data if the key && date don’t exists
I have done a lot of research and read through multiple stackoverflow questionso on firebase. Some were kind of helpful. But none that particularly helped my problem. I am trying to make a menu planner. There for I need more than one check to test if for example. Date exists, serviceType is === to “lunch” || “dinner”. I have a
firebase order by datetime desc and asc
so i learn something new from firebase realtime for chat purpose.. but i still confuse how to make an action “how to order by like php” so i have some code like this here my database How to order limit asc and desc method with lastupdate child? im search for reference that mostly tutorial for android. Answer You’re already retrieving
Before/After properties without change are not equal in firestore-triggered Cloud Function
I have a firestore collection called events that contains documents with the fields begin, end and title. The function is triggered if a document was changed. begin and end are of type timestamp. I want my function to return false if begin or end was changed. In my cloud function, I check if the respective before and after data is
Upgrade to Firebase JS 8.0.0: Attempted import error: ‘app’ is not exported from ‘firebase/app’ (imported as ‘firebase’)
After upgrading to 8.0.0, I get the following error: Attempted import error: ‘initializeApp’ is not exported from ‘firebase/app’ (imported as ‘firebase’). My import looks like this: TypeScript also complains: Property ‘initializeApp’ does not exist on type ‘typeof import(“/path/to/my/file”)’. ts(2339) How do I fix this? Answer In version 8.0.0, the Firebase SDK had a breaking change in the way it handles