我无法让最简单的Firebase Cloud Function正常执行。下面的代码除了错误Error: function crashed out of request scope
和Function invocation was interrupted.
exports.testFunction = functions.firestore.document('trigger/dummy2').onUpdate(async (change : any, context : any) => {
console.log( "How can this fail?" );
});
答案 0 :(得分:1)
从文档中看(至少对我而言)并不明显,但是需要async
函数才能返回Promise。如果这是不相关的要求,则可以返回已解决的承诺。
exports.testFunction = functions.firestore.document('trigger/dummy2').onUpdate(async (change : any, context : any) => {
console.log( "How can this fail?" );
return Promise.resolve(100);
});