CodexBloom - Programming Q&A Platform

GCP Cloud Function scenarios to Trigger Due to 'Event Type Not Supported' scenarios with Firestore

👀 Views: 53 💬 Answers: 1 📅 Created: 2025-06-12
google-cloud-functions firestore firebase gcp JavaScript

I've tried everything I can think of but I'm trying to debug I've looked through the documentation and I'm still confused about I've searched everywhere and can't find a clear answer... I'm working on a project and hit a roadblock. I'm trying to set up a Google Cloud Function that triggers on document creation in Firestore. I have configured the function to listen for the `providers/cloud.firestore/eventTypes/document.create` event, but when I deploy the function, I receive an behavior stating 'Event type not supported'. I've verified that the function is deployed in the correct project where the Firestore database resides. Here's the command I'm using to deploy: ```bash gcloud functions deploy myFunction \ --trigger-event-firebase.firestore.document.create \ --trigger-resource 'projects/my-project/databases/(default)/documents/my-collection/{docId}' \ --runtime nodejs14 \ --entry-point myFunctionHandler ``` My function handler looks like this: ```javascript const functions = require('firebase-functions'); exports.myFunctionHandler = functions.firestore.document('/my-collection/{docId}') .onCreate((snap, context) => { const newValue = snap.data(); console.log('New document created:', newValue); }); ``` I've confirmed that the Firebase SDK is included in my `package.json`: ```json { "dependencies": { "firebase-functions": "^3.14.1" } } ``` I've also checked the IAM permissions for the service account running the function; it has the `Cloud Functions Admin` and `Firestore Admin` roles assigned. I’ve tried re-deploying the function multiple times and even created a new Firestore database to eliminate any configuration issues but still encounter the same behavior. Is there something I might be missing in the setup that could be causing this scenario? For context: I'm using Javascript on Linux. For context: I'm using Javascript on Windows. How would you solve this? For context: I'm using Javascript on macOS. Any help would be greatly appreciated! My development environment is Windows 11. Could this be a known issue? I'm developing on Windows 10 with Javascript. Thanks for your help in advance!