首页 > 解决方案 > Firebase 计划功能 - 无法部署

问题描述

我的代码:

exports.scheduledFunction = functions.pubsub.schedule('every 5 minutes').onRun((context) => { console.log('This will be run every 5 minutes!'); }); 

要部署我运行:

firebase deploy --only functions:scheduledFunction 

尝试部署计划功能时遇到此问题

src/index.ts(490,18):错误 TS2339:“typeof”/functions/node_modules/firebase-functions... 类型上不存在属性“schedule”

标签: firebasegoogle-cloud-functions

解决方案


pubsub.schedule()触发器是在2.3 版firebase-functions中添加的。很可能您使用的是比该版本更旧的版本。


推荐阅读