I have firebase cloud schedule function. It works fine for the first two periods, but then it stops. my function codes are below. I am not experienced in javascript. Is there any mistake in my codes? I am attaching the logs. 12:07:04.314 AM -> worked fine 6:07:03,658 AM -> worked fine 12:07:04.314 PM -> not calling current date now ->
Tag: firebase
TypeError: Cannot read property ‘addEventListener’ of null when i want to add new elements to my database
I created a form to create new post from the auth users however im getting this error “Uncaught TypeError: Cannot read property ‘addEventListener’ of null” and cant seem to know why my script is at the end of the HTML and its an external file, I’ve used eventListener in other places and it work just fine. I’ve even checked for
Angular: conditionally render based on whether value was received from Firebase DB
I have a component: I am currently displaying the data I receive inside a swiper in the HTML template with no problems: However, I now want to display the part above only after items have been loaded. And display something else (a loading indicator) while it loads. So I am planning something like this: My only problem is that I
Saving Date to firestore document in Javascript
I have a function that converts date string to Date Then I use as following: But on firebase console, the birthdate is stored as an empty array as the image bellow: What I am doing wrong? Answer convertStringToDate returns a Date object, which if you console log, will show up something like this: If you want to store it as
share firestore collection paths across admin and web
I’d like to make re-usable functions that get the Firestore Document/Collection reference across web and admin (node.js). for example: This will reduce errors and coordinate changes across both environments. Problem: Admin imports firestore from firebase-admin, and web imports from firebase. I’ve tried making some class/function where I pass in my firestore reference, but it becomes a pain where I have
Firestore: get an array of objects
Is it possible to get an array of objects from Firestore. I tried something like below but I am getting undefined when I tried to log comments[0].comment Answer This returns a QuerySnapshot which contains the DocumentSnapshot of each document that has matched your query. The array of object is a field in your document. You cannot get a single field
Firestorage has different behavior when hardcode
I don’t know what happened with my code. But everytime i used this code is working But when i switched to urlPathThumbs it will become error 404. Error said like so Firebase Storage: Object ‘courses/m9APF8TEUnfS6IQew591sl4kphH2/thumbs/Rectangle 68 (1)_200x200.png’ does not exist. (storage/object-not-found) however they both are same pattern. This is how variable urlPathThumbs created in previous snippet code this file is
Firebase Storage – Upload Image with React Native, Error loading Preview
This is the code which I use to upload images to firebase storage But when I check the firebase console it shows, error loading preview, and the file size is 9B for a image. Is there something Im missing. Im using Expo managed, expo-image-picker to select images. Answer I found a way, I had to create a blob and then
Invoking Firebase Function from Firebase hosting code blocked by CORS
I’ve initialized a templated Firebase project with functions & hosting features. I’ve uncommented the templated HTTP function: And Also added the following code to the templated public/index.html file: I’ve tried making this work with multiple configurations: Firebase emulator for hosting, invoking the deployed Firebase function. Firebase emulator for hosting, invoking the emulated function (Firebase functions emulator). The deployed hosting, invoked
How to do arrayUnion on an array of objects inside another array of objects in firebase firestore?
I have created a comment section in my react app. The comment section has following data structure in the firestore:- If I want to add a new comment I do this by: – Now, what I actually want to do is to do is to add a new reply to the existing comment. But I can’t find any way to