skip to Main Content

I am trying to deploy the firebase functions and getting the error:

Error: Failed to fetch Run service undefined`

I’ve already tried to update firebase-tools, but it did not help. Could you please help to resolve it?

7

Answers


  1. Make sure that firebase-tools is actually updated. Try firebase --version and see if it is v11.18.0.

    I had firebase installed with pnpm globally, so npm update did not actually update the correct package.

    Login or Signup to reply.
  2. I had same error in windows 10.
    firebase deploy --only functions

    v11.18.0 has fixed the error.

    npm install -g firebase-tools --force
    
    npm audit fix
    
    Login or Signup to reply.
  3. After a day of try and error. I noticed that no matter what I do the firebase --version never updates. v11.0.1 or whatever it is in your case.
    I tried a simple workaround on this problem as following:

    1. Downloaded the firebase standalone binary from their official webpage
    2. [optional] copied it to C:firebase (For easy access next time)
    3. Run it from there, it will open up a terminal, you can now cd E:somefilelocationtocloud_functions then you can do firebase init and firebase deploy
      Furthermore, while you’re having the terminal opened, you can check firebase --version to see that this terminal does have the latest version of the firebase-tools unlike the global windows cmd. At least this solved the problem for me, I wanted to share it in case it might help someone!
    Login or Signup to reply.
  4. As others have pointed out, this is an issue with an older version.

    Manual workaround: before deployment, go to Firebase admin console, and delete all existing cloud functions there. If the console is clean, the deploy command will work.

    Proper solution: Upgrade firebase cli version.

    On macOS, I noticed no matter how many times I run npm install it never actually updated.

    This command finally updated it for me:

    curl -sL https://firebase.tools | upgrade=true bash

    Verify it using firebase --version, mine is at 11.22.0 now.

    Login or Signup to reply.
  5. also check node version. I had node 16 selected and it was too new for firebase-functions 3.20.0 and npm 8.19.3.
    Selecting with nvm use 14 did the trick here.

    Login or Signup to reply.
  6. Another quick workaround will be to deploy the function through the google cloud console directly.

    Login or Signup to reply.
  7. Installing the latest version of the firebase-functions package and changing node from 10 to 14 in functions/package.json did it for me. Deleting package.json might also be wise.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search