I have been trying to deploy cloud function but it always fails. I tried to deploy a simple cloud function but it is not working and can not find any error too. and I am in Blaze plan
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
// Firestore collection to listen to
const collectionName = 'testCollection';
exports.logNewDocument = functions.firestore
.document(`${collectionName}/{documentId}`)
.onCreate((snapshot) => {
const newValue = snapshot.data();
// Log the new document's data
console.log(`New document added to ${collectionName}:`, newValue);
return null;
});