title: Delete a Firebase Cloud Function which failed with `Deploy Error: undefined`
body: <p>How can I delete a <em>Firebase Cloud Function</em> which deployed with <code>Deploy Error: undefined</code>?
  <hr></p>
  
  <h3>Steps to reproduce my problem:</h3>
  
  <p>1) Create a new <em>Firebase</em> project</p>
  
  <p>2) <code>$ firebase init</code> and setup functions</p>
  
  <p>3) Paste the following code into <code>functions/index.js</code></p>
  
  <pre><code>"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 =&gt; {});
  </code></pre>
  
  <p>4) <code>firebase deploy --only functions</code></p>
  
  <p>5) The function will fail to deploy as expected.</p>
  
  <p><hr></p>
  
  <h3>What I tried to delete the <em>Cloud Function</em>:</h3>
  
  <ul>
  <li>Removing the function from the <code>index.js</code> and deploying does not delete the function, instead I get <code>functions[thisFnWillFailToDeploy]: Deploy Error: undefined</code></li>
  <li>Deleting the <em>Cloud Function</em> in the <em>Google Cloud Console</em> 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 <code>"status":{"code":13}</code>)</li>
  <li>Creating an empty cloud function with the name <code>thisFnWillFailToDeploy</code> also results in <code>Deploy Error: undefined</code></li>
  </ul>