【发布时间】:2019-10-17 04:45:17
【问题描述】:
我最近在我的项目中添加了一个新的云功能,但由于某种原因,我在部署时跳过了它:
firebase deploy --only functions:stripeOperation
导致
⚠ 功能:指定了以下过滤器但不匹配 项目中的任何函数:stripeOperation
文件结构是这样的:
functions/
├── src/
│ ├── stripe
│ │ ├── index.ts
│ │ ├── myTrigger.ts
│ │ ├── anotherTrigger.ts
│ │ └── stripeOperation.ts
│ ├── index.ts
functions/src/stripe/index 导出条带文件夹中的所有 3 个函数。
functions/src/index 将它们从条带文件夹中导出:
export { stripeOperation, myTrigger, anotherTrigger } from './stripe';
这就是奇怪的地方 - myTrigger 和 anotherTrigger 成功部署,但 stripeOperation 没有。没有构建错误。 Firebase 没有给我任何关于它为什么被跳过的线索。我检查了一下,转译的代码看起来不错。 stripeOperation 是一个可调用函数,但另外两个是 firestore 触发器。这是stripeOperation的签名:
export const stripeOperation = functions.https.onCall((data, context) => {
...
});
有什么方法可以确定为什么 firebase 不会部署我的功能?我正在使用"firebase-functions": "^2.3.1"
更新:我尝试重命名函数,并用之前部署的函数完全切换函数体,但都没有成功。
【问题讨论】:
-
您也可以在问题中添加
stripeOperation的签名吗?我怀疑它真的会有所不同,但想确定一下。 -
我更新了我的示例以包含
stripeOperation的签名
标签: firebase google-cloud-functions