Delete a Firebase Cloud Function which failed with `Deploy Error: undefined`

Viewed 1895

How can I delete a Firebase Cloud Function which deployed with Deploy Error: undefined?


Steps to reproduce my problem:

1) Create a new Firebase project

2) $ firebase init and setup functions

3) Paste the following code into functions/index.js

"use strict";
const functions = require('firebase-functions');

function aFunction() {
    return 'reports/posts';
}

function getCorruptTrigger() {
    return '/reports/posts/' + aFunction +'/createdAt'
}

exports.thisFnWillFailToDeploy = functions
    .database
    .ref(getCorruptTrigger())
    .onWrite(event => {});

4) firebase deploy --only functions

5) The function will fail to deploy as expected.


What I tried to delete the Cloud Function:

  • Removing the function from the index.js and deploying does not delete the function, instead I get functions[thisFnWillFailToDeploy]: Deploy Error: undefined
  • Deleting the Cloud Function in the Google Cloud Console does not delete the function. (I get a toast saying that the function will be deleted, but this is not the case. In the logs there is an Error with "status":{"code":13})
  • Creating an empty cloud function with the name thisFnWillFailToDeploy also results in Deploy Error: undefined
1 Answers
Related