Search code examples
androidnode.jsfirebasegoogle-cloud-functionsfirebase-cli

my firebase function is being deleted when i try to upload new one


I want to create a function for a push notification but when I try to upload new function then the previous function which is for different purpose is being deleted . I don't know why currently I have 3 functions. This is the screenshot of my node js


Solution

  • This is the way deployments with the Firebase CLI work by default. Every time you deploy, all the functions you deploy completely replace any other functions you previously deployed.

    If you want to deploy only certain functions without replacing everything, you need to specify that on the command line as described in the documentation:

    When deploying functions, you can target specific ones:

    firebase deploy --only functions:function1
    firebase deploy --only functions:function1,functions:function2