简体   繁体   中英

Why the following error when I deploy a function to firebase for realtime database

TypeError: Cannot read property 'val' of undefined at exports.onDataAdded.functions.database.ref.onCreate.event (/user_code/index.js:5:28) at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27) at next (native) at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71 at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12) at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:82:36) at /var/tmp/worker/worker.js:710:26 at process._tickDomainCallback (internal/process/next_tick.js:135:7) This is my structure

The error was due to the uses of deprecated things.FCM has been updated from beta to 1.0.0. Now the difference can be seen in the following documentation- https://firebase.google.com/docs/functions/beta-v1-diff#realtime-database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM