Firebase functions are not being deployed while they used to be deployed without any problem
See original GitHub issue[REQUIRED] Environment info
firebase-tools:8.9.0
Platform:macOS Big Sur v11.4
[REQUIRED] Test case
package.json:
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "10"
},
"dependencies": {
"body-parser": "^1.19.0",
"child-process-promise": "^2.2.1",
"express": "^4.17.1",
"firebase-admin": "^9.11.0",
"firebase-functions": "^3.14.1",
"gm": "^1.23.1",
"lodash": "^4.17.21",
"mkdirp-promise": "^5.0.1",
"node-forge": "^0.10.0",
"sharp": "^0.26.1"
},
"devDependencies": {
"firebase-functions-test": "^0.1.6",
"tslint": "~5.8.0",
"typescript": "^3.3.4000"
},
"private": true
}
[REQUIRED] Steps to reproduce
Deploy a test function using package.json above
[REQUIRED] Expected behavior
The functions used to be deployed without any problem the last time I tried, which is 2-3 days ago, and should continue to do so.
[REQUIRED] Actual behavior
I cannot deploy any of the functions. All of the functions throw the following errors:
Function failed on loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.
From Firebase console I see the following error messages:
Provided module can’t be loaded. Did you list all required modules in the package.json dependencies? Detailed stack trace: Error: Cannot find module ‘typescript’
The problem is I have all the necessary packages including Typscript installed.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hi, this works now. It was a really silly mistake. While writing a new function, VS Code was smart enough to somehow automatically import the following module at the top:
const { isExpressionWithTypeArguments } = require(‘typescript’);
Which led to all the errors. Silly mistake. Killed it dead, installed the new version globally, everything’s fine. Thanks for helping out though!
@pmabres The
bad CRC
error message reminds me of firebase/firebase-tools/issues/3120.It does sound like a new issue unrelated to this issue. Let us know by opening up a new issue (hopefully w/ steps to reproduce your error).