firebase-functions: Cannot deploy any firebase functions on any project

Related issues

[REQUIRED] Version info

node: 12.20

firebase-functions: 3.11 and 3.13

firebase-tools: 9.0.0

firebase-admin: 9.2.0

[REQUIRED] Test case

just create a new firebase project, add billing, and then ‘firebase init’ with only functions, and then deploy

[REQUIRED] Steps to reproduce

# Install dependencies
apt-get update
apt-get -y install apt-transport-https ca-certificates gnupg curl sudo gcc g++ make rsync git

# Add nodejs for firebase deploy
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt-get update && apt-get install -y nodejs

# Install firebase tools
npm install -g firebase-tools

#npm install cloud functions
cd $PROJECT_DIR/firebase/app
firebase init
cd functions
npm install

 # Deploy
cd $PROJECT_DIR/firebase/app
firebase deploy --debug --only functions

[REQUIRED] Expected behavior

functions deploy

[REQUIRED] Actual behavior

throws an error (the extra output here is from --debug ):

[2020-12-16T13:08:49.705Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/XXX/locations/-/functions

[2020-12-16T13:08:50.408Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 16 Dec 2020 13:08:50 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-12-16T13:08:50.426Z] TypeError: checkForNode8 is not a function
    at /usr/lib/node_modules/firebase-tools/lib/deploy/functions/release.js:413:13
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Error: An unexpected error has occurred.

Having trouble? Try again or contact support with contents of firebase-debug.log

Were you able to successfully deploy your functions?

worked fine yesterday, not anymore

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 20 (1 by maintainers)

Most upvoted comments

@shubhangchourasia do

firebase deploy --debug --only "functions:helloWorld"

that might give you more info, and determine if it’s the same issue as the rest of us

Is the Firebase team here active or should we move and report this to Google Issue Tracker instead?

const functions = require(‘firebase-functions’) const admin = require(‘firebase-admin’) These are the two important lines we write in our functions. Is there any other dependency you are using in the firebase functions or just these two ?

There is no problem with my index.js and yes there are some third library included but that is not the problem and supposed to be not a problem. The issue is the deployment gets terminated and failed, out of 20 trial most likely only 2 got it success the rest always failed. Some function get updated but others failed.

That’s an issue. If one gets updated and other not. In my case I was using razorpay dependency. I did

npm i razorpay

at root directory. But while deploying it was unable to find razorpay. But it was there in my package.json file. Then I changed my directory to /functions and again did npm i razorpay. This time it appeared in the package.json present inside the functions folder. And I was able to deploy the function.