Skip to content
Advertisement

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

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

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

Advertisement