我正在为上传到Firebase数据库后调整图像大小的触发器进行设置,但是我收到了以下消息:错误:“onChange”现已弃用,请使用“onArchive”,“onDelete”,“onFinalize”或“onMetadataUpdate”。在ObjectBuilder.onChange(/ home / kill / trigger/functions/node_modules/firebase-functions/lib/providers/storage.js:88:15)处,我也尝试了: functions.storage.object().onArchive,它在终端上可以工作,但当我在Firebase GUI中检查函数时,会出现错误代码:13,“无法配置触发器..”,有人能帮帮我吗?谢谢大家。
const functions = require('firebase-functions');
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
exports.onFileChange = functions.storage.object().onChange(event => {
console.log(event);
return;
});