firebase - 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”
解决方案
pubsub.schedule()
触发器是在库的2.3 版firebase-functions
中添加的。很可能您使用的是比该版本更旧的版本。
推荐阅读
- firebase - FormatException:意外字符(在字符 1 处) - firebase 身份验证
- python - 两个数字(0.85,0.18)之间的 T 检验将 p 值设为 Nan
- c++ - C++:模板类型的提取
- angular - 模板引用变量给出_r0不是函数错误
- firebase - 过滤 Firebase 数据库中的 2 个项目
- docker - 按照 Realms 中的一般概述启用 Docker Bearer Token Realm
- r - 将具有多个维度的数据框转换为栅格图层
- java - 从 BLE 读取多个特征并读取字符串
- forms - 无法使用 pyrevit 表单
- android - 如何修复 RTL 对称警告