GCP Cloud Functions triggered by Firestore not executing on document updates - 'Function not found' scenarios
Quick question that's been bugging me - I'm working with an scenario with my GCP Cloud Functions that are supposed to trigger on updates to a Firestore document. I've set everything up according to the documentation, but when I update a document, the function isn't executing, and I'm seeing 'Function not found' in the logs. My Cloud Function is written in Node.js 14 and is set to trigger on updates to a specific collection. Here's the function code: ```javascript const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); exports.onUpdateDocument = functions.firestore.document('myCollection/{docId}') .onUpdate((change, context) => { const newValue = change.after.data(); console.log('Document updated:', newValue); // Additional logic here }); ``` In my Firestore rules, I have allowed read and write access for testing: ```plaintext service cloud.firestore { match /databases/{database}/documents { match /myCollection/{document=**} { allow read, write: if request.auth != null; } } } ``` I've deployed the function using the CLI with `firebase deploy --only functions`, and it indicates a successful deployment. However, when I go to update a document in the Firestore console, I don't see any logs from the function and the UI shows 'Function not found' for the trigger. I've tried redeploying the function multiple times and ensured that the Firestore path in the trigger matches exactly with the collection name. I've verified that my Firebase project is correctly linked to the Cloud Functions. Is there something I'm missing or a specific configuration that could cause this scenario? Any help would be greatly appreciated! My development environment is macOS. What's the best practice here?