firebase / firebase/firebase-tools
Firebase Functions failing to deploy: npm ERR! Cannot read properties of undefined (reading '@google-cloud/functions-framework')
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
### [REQUIRED] Environment info
**firebase-tools: 13.24.1**
**Platform: MacOS (15.0.1)**
```
$ uname -a
Darwin MacBookPro.lan 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 arm64
```
### [REQUIRED] Test case
I have had Firebase Functions (v1) running and deploying for a while. Today, I am seeing this error while deploying:
```
firebase deploy --only functions:myFuncName
✔ functions: Finished running predeploy script.
i functions: preparing codebase default for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
i functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8888
i extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
✔ extensions: required API firebaseextensions.googleapis.com is enabled
i functions: preparing functions directory for uploading...
i functions: packaged /Users/arnab/code/projects/directory-management-tools/functions (318.2 KB) for uploading
✔ functions: functions folder uploaded successfully
i functions: updating Node.js 18 (1st Gen) function myFuncName(us-central1)...
Build failed: npm ERR! Cannot read properties of undefined (reading '@google-cloud/functions-framework')
npm ERR! A complete log of this run can be found in:
npm ERR! /www-data-home/.npm/_logs/2024-11-06T00_04_48_347Z-debug.log; Error ID: f0ad4164
Functions deploy had errors with the following functions:
myFuncName(us-central1)
i functions: cleaning up build files...
Error: There was an error deploying functions
```
### [REQUIRED] Steps to reproduce
I have a pretty large repository with 20+ functions (all v1) all running for over a year.
My Firebase-Functions dependencies:
```
"firebase-admin": "^12.7.0",
"firebase-functions": "^6.1.0",
```
I have also tried downgrading both these dependencies, as well as `firebase-tools` and keep seeing the same error.
### [REQUIRED] Expected behavior
Not fail to deploy.
### [REQUIRED] Actual behavior
See the above details. Essentially, the main error is:
```
Build failed: npm ERR! Cannot read properties of undefined (reading '@google-cloud/functions-framework')
npm ERR! A complete log of this run can be found in:
npm ERR! /www-data-home/.npm/_logs/2024-11-06T00_04_48_347Z-debug.log; Error ID: f0ad4164
```
Contributor guide
Assessment
This issue has not been assessed yet.