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
0
votes
1 Answers
0
votes
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
val
. – Doug Stevenson