Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not see the Firebase function deployed

I followed the following steps:

  1. The Firebase CLI (Command Line Interface) requires Node.js and npm, which you can install by following the instructions on https://nodejs.org/

    • Installing Node.js also installs npm
  2. Once you have Node.js and npm installed, install the Firebase CLI via npm:
    npm install -g firebase-tools

    • This installs the globally available firebase command. To update to the latest version, re-run the same command
  3. Initialize your project:
    a. Run firebase login to log in via the browser and authenticate the firebase tool.

    b.Go to your Firebase project directory or create the directory

    c. Run firebase init functions

    • The tool gives you an option to install dependencies with npm. It is safe to decline if you want to manage dependencies in another way.
  4. Select associated firebase project

  5. Select Y to install dependencies with npm

  6. Move to directory setup firebase functions

  7. Edit index.js file with the function you created

  8. Run the firebase use --add to add your Firebase project

  9. Run firebase deploy --only functions to deploy the function

After all this I get the message in the terminal at deploy was completed but in the Firebase console, when i click on Functions tab there are no functions listed!?

like image 743
Learn2Code Avatar asked Mar 25 '17 18:03

Learn2Code


People also ask

What does firebase deploy -- only functions do?

Running firebase deploy --only functions deletes the existing functions before creating new ones.

How do you update a file that I deployed to firebase hosting?

You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.


1 Answers

Quick Tip: Make sure you are exporting the function you are trying to deploy in your index.js file. Your firebase project will deploy but Cloud Functions won't be available unless they are exported.

like image 198
Lindauson Avatar answered Oct 02 '22 22:10

Lindauson