CodexBloom - Programming Q&A Platform

GCP Cloud Functions Deployment scenarios with 'Function not found' scenarios After Updating Dependencies

👀 Views: 64 💬 Answers: 1 📅 Created: 2025-06-23
google-cloud-functions node.js gcp JavaScript

I'm migrating some code and I'm having trouble with I'm relatively new to this, so bear with me. I'm working with an scenario when deploying my Google Cloud Function that processes incoming HTTP requests using the `@google-cloud/storage` library. After updating the library from version 5.8.2 to 6.0.0, my function deployment fails with the behavior: `Function not found: projects/my-project-id/locations/us-central1/functions/myFunction`. I confirmed that the function exists and I didn't change its name or trigger. My `package.json` looks like this: ```json { "name": "my-cloud-function", "version": "1.0.0", "main": "index.js", "dependencies": { "@google-cloud/storage": "^6.0.0", "express": "^4.17.1" } } ``` In `index.js`, I have a simple function set up: ```javascript const functions = require('firebase-functions'); const { Storage } = require('@google-cloud/storage'); const storage = new Storage(); exports.myFunction = functions.https.onRequest((req, res) => { res.send('Hello World!'); }); ``` I’ve tried reverting back to version 5.8.2 and redeploying, which worked fine, but I need the features in the latest version. Additionally, I ensured that the IAM permissions are correctly set for the service account used by the function. Does anyone know if there are breaking changes or specific migration steps I need to follow after updating the `@google-cloud/storage` library? Any help would be appreciated! For context: I'm using Javascript on Windows. Thanks in advance! This is for a REST API running on Debian. Any examples would be super helpful.