question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

firebase deploy --remove functions or hosting

See original GitHub issue

Old function sticks in firebase when you rename a function after the first deployment

Deploy this function:

exports.helloFn1 = functions.https.onRequest((request, response) => {
    response.send("Hello from Fn1!");
});

call, and then edit the index.js and change it to:

exports.helloFn2 = functions.https.onRequest((request, response) => {
    response.send("Hello from Fn2!");
});

firebase deploy --only functions

In the firebase console, both functions is there, with no option to delete it.

You can delete it in the cloud console https://console.cloud.google.com but admin will be done from the deployment point of view? Or how is the plan to deploy functions by name from different places?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

10reactions
bkendallcommented, Nov 1, 2018

Right now there’s a known issue where removing the function from your deployed file(s) (e.g. index.js) doesn’t remove the function. See #982 for more details.

Short version:

  • firebase deploy --only functions will tell you that it will remove functions, but not actually do so. Run this to know what will be removed.
  • firebase deploy --only functions --force will remove the noted functions, but will not ask for confirmation. This will actually delete the removed (from code) functions.

(Be sure you’re on the latest firebase-tools as well!)

5reactions
laurenzlongcommented, Jun 1, 2017

What @mbleigh had meant is that if the functions are no longer in functions/index.js when you deploy (because you deleted or commented out the code), then it will be deleted. If that is not working, then go to https://cloud.google.com/console/functions/list, click on the three dots to right of the function you’d like to delete to expand the menu, then click on “delete”. Please reopen this issue if you’re still experiencing problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage functions | Cloud Functions for Firebase - Google
You can deploy, delete, and modify functions using Firebase CLI commands or by setting runtime options in your functions source code.
Read more >
Undeploy functions in firebase hosting
Using firebase itself, the only way I am aware of is to deploy an empty/do-nothing function, which will overwrite your existing function(s).
Read more >
Solved: Firebase deploy functions fails
Solved: After updating firebase-functions to 4.0.0 or 4.0.1, trying to deploy my functions with the firebase CLI is success.
Read more >
When Your Firebase Cloud Functions Don't Want to Deploy ...
You can deploy, delete, and modify functions using Firebase CLI commands or by setting runtime options in your… firebase.google.com.
Read more >
Deploy Firebase Functions using GitHub Actions - Dave Sugden
When setting up Firebase Hosting, the Firebase CLI will helpfully ask you if you want to set up automation. It will configure a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found