firebase - firebase 函数组部署错误(未定义)
问题描述
我正在尝试部署 firebase 函数 index.js 文件。如果我尝试部署单个功能,例如(firebase deploy --only functions:phaseStart),它运行良好。但是,如果我部署整个函数文件夹,例如(firebase deploy --only 函数),就会出现错误。我昨天刚刚部署了这个功能,但这些都没有发生。index.js 文件有问题吗?还是我部署了这么多功能?
错误代码如下。
+ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
+ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (46.47 KB) for uploading
+ functions: functions folder uploaded successfully
i functions: updating Node.js 8 function roomRemoved(asia-northeast1)...
i functions: updating Node.js 8 function gameStart(asia-northeast1)...
i functions: updating Node.js 8 function phaseStart(asia-northeast1)...
i functions: updating Node.js 8 function nightAction(asia-northeast1)...
i functions: updating Node.js 8 function vote(asia-northeast1)...
i functions: updating Node.js 8 function userCreated(asia-northeast1)...
i functions: updating Node.js 8 function userDeleted(asia-northeast1)...
! functions[userDeleted(asia-northeast1)]: Deployment error.
undefined
! functions[phaseStart(asia-northeast1)]: Deployment error.
undefined
! functions[vote(asia-northeast1)]: Deployment error.
undefined
! functions[gameStart(asia-northeast1)]: Deployment error.
undefined
! functions[roomRemoved(asia-northeast1)]: Deployment error.
undefined
! functions[nightAction(asia-northeast1)]: Deployment error.
undefined
+ functions[userCreated(asia-northeast1)]: Successful update operation.
Functions deploy had errors with the following functions:
gameStart
nightAction
phaseStart
roomRemoved
userDeleted
vote
To try redeploying those functions, run:
firebase deploy --only functions:gameStart,functions:nightAction,functions:phaseStart,functions:roomRemoved,functions:userDeleted,functions:vote
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
我还在firebase控制台上找到了审计日志。
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"INTERNAL"},"authenticationInfo":{"principalEmail":"blabla"},"requestMetadata":{"requestAttributes":{},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/blabla/locations/asia-northeast1/functions/gameStart"}
这是我的职能之一。
exports.userDeleted = functions
.region('asia-northeast1')
.auth.user().onDelete(async user => {
return db.collection('uid_list').doc(user.uid).delete().catch(e => {
console.error(e.code)
console.log(e.message)
})
})
解决方案
推荐阅读
- ag-grid - 如何使用单独的按钮在 ag 网格中展开 Master Detail?
- react-native - 在 iPhone X 上处理 ReactNative 中的 SafeArea
- python - 字符类在正则表达式中算作组吗?
- android - 单击子项中的按钮删除或删除可展开的列表视图项
- javascript - vue.js 不知道如何通过 props 将数据传递给另一个组件
- python-3.x - 如何用 Python 画图?
- amazon-dynamodb - 使用全局二级索引从 Dynamo DB 查询数据
- asp.net - 如何使用 asp.net Web Api 中的表单数据在 API 中对对象上传进行建模
- javascript - 为什么即使在反应中调用 e.nativeEvent.stopPropagation 后事件也会传播到父级?
- flutter - 如何在颤动的垂直列表视图中创建水平列表视图