Can not see the Firebase function deployed

后端 未结 15 798
失恋的感觉
失恋的感觉 2021-02-02 08:23

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

相关标签:
15条回答
  • 2021-02-02 09:06

    Had the same issue.

    In my case solved by using firebase deploy wihtout any --only, which revealed better error messaging and I had to setup billing in Cloud Console for the project. The setup routine can be triggered by selecting Could Functions in the Console.

    I had another issue in which the Service Account was missing from the Project, so I setup a fresh project through the Console first and then added this to Firebase.

    0 讨论(0)
  • 2021-02-02 09:08

    Make sure you're running at least version 3.5.0 of firebase-tools. To check which version you have, run:

    firebase --version
    

    If you're running the default setup, you can update firebase-tools using:

    npm install -g firebase-tools
    
    0 讨论(0)
  • 2021-02-02 09:10

    Use firebase projects:list and firebase use <project> to make sure the Firebase CLI's "current project" is set correctly regardless of what folder you're in.

    Example:

    > firebase projects:list
      ✔ Preparing the list of your Firebase projects
      ┌──────────────────────┬─────────────────────┬──────────────────────┐
      │ Project Display Name │ Project ID          │ Resource Location ID │
      ├──────────────────────┼─────────────────────┼──────────────────────┤
      │ alpha                │ alpha     (current) │ [Not specified]      │
      ├──────────────────────┼─────────────────────┼──────────────────────┤
      │ beta                 │ beta                │ [Not specified]      │
      └──────────────────────┴─────────────────────┴──────────────────────┘
    
      2 project(s) total.
    
    > firebase use beta
      Now using project beta
    
    0 讨论(0)
  • 2021-02-02 09:11

    To clarify one issue - it appears as though your index.js file inside the functions folder must export functions created within the same file (similar to what Fran had said).

    It seems trying to organize your files into subfolders will not work properly with Firebase functions - same rules apply for using firebase serve to test locally (must create codeinside functions/index.js).

    Hope this helps someone!

    0 讨论(0)
  • 2021-02-02 09:14

    Check your "default project" at firebase init. Select one with similar name was my mistake. ;)

    0 讨论(0)
  • 2021-02-02 09:15

    I went through the same issue recently, while performing Actions on Google Node.js Client Library Version 1 Migration Guide. to Node.js Client Library V2 (That I highly recommend) It took me a while to figure out what what was happening. At the I couldn't really figure out what the problem was! So here is what I did and it worked for me:

    1. Make sure you have a backup copy of your cloud functions (index.js) and maybe your package.json (Just in case you don't want to remember what packages you previously had installed - Could be annoying sometimes).

    2. Delete the entire functions directory from your project folder.

    3. Re-launch firebase CLI with firebase init and choose Functions

    4. Once your cloud function have been initialized, CD into the functions folder and Redeploy it using firebase deploy --only functions.

    5. If everything goes well

    0 讨论(0)
提交回复
热议问题