【发布时间】:2018-01-07 07:10:09
【问题描述】:
如何删除使用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 - 在 Google Cloud Console 中删除 Cloud Function 不会删除该函数。 (我得到一个祝酒词,说该功能将被删除,但事实并非如此。在日志中有
"status":{"code":13}的错误) - 创建一个名为
thisFnWillFailToDeploy的空云函数也会导致Deploy Error: undefined
【问题讨论】:
-
如果您在项目中看到无法解释的错误,请联系故障排除支持。他们最有能力帮助您。 firebase.google.com/support/contact/troubleshooting
-
如果没有人知道解决方案,我会写一个错误报告。不想为此浪费宝贵的支持票 ;)
-
我怀疑您的项目存在问题,而不仅仅是一些错误或错误。用一个新项目再试一次以确定是否正确。
-
其实我就是这么做的。我在我的项目中遇到了这个问题。上面提到的步骤是我如何能够在一个全新的项目中重现相同的情况。 (由于我对 Google Cloud Console 和 Firebase Cloud Functions 相当缺乏经验,我不确定我是否只是遗漏了一些东西。这就是我首先在这里提交问题的原因)
-
我复制了你的代码(添加了缺少的括号和分号)并成功部署,你能解决吗?
标签: firebase firebase-realtime-database google-cloud-functions