如何删除使用Deploy Error: undefined
部署的 Firebase云功能?
1)创建一个新的 Firebase 项目
2)$ firebase init
和设置功能
3)将以下代码粘贴到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)该功能将无法按预期部署。
<小时/>
index.js
删除该功能并进行部署不会删除该功能,而是获得functions[thisFnWillFailToDeploy]: Deploy Error: undefined
"status":{"code":13}
错误thisFnWillFailToDeploy
的空云功能也会产生Deploy Error: undefined
答案 0 :(得分:2)
项目中的该功能处于不良状态。显然,部署具有格式错误的ref的函数会导致该函数出现问题而无法自行解决。该功能将从一开始就无法部署(甚至没有机会删除它)。之后,您无法再更新或删除该功能。如果您需要,您必须联系支持部门以恢复该功能。您仍然可以更新或删除该项目中的其他功能。
我猜这是因为你的函数调用中有一个拼写错误,它产生了ref的名字。你在aFunction的召唤中错过了一些parens。我想你的意思是这样的:
function getCorruptTrigger() {
return '/reports/posts/' + aFunction() +'/createdAt'
}
如果您在新项目中部署它,它应该可以工作。