when I execute the observeFollowing function (08:56) I get this error
TypeError: Cannot read property 'uid' of undefined
at exports.observeFollowing.functions.database.ref.onCreate.event (/user_code/index.js:14:25)
at Object.<anonymous> (/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:700:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
so I comment those lines out and just print out "event" in the logs:
I get the followin
app:
FirebaseApp {
firebaseInternals_:
FirebaseNamespaceInternals {
firebase_: [Object],
serviceFactories: {},
apps_: [Object],
appHooks_: {} },
services_: {},
isDeleted_: false,
name_: '__admin__',
options_:
{ projectId: 'instagramfirebase-!@#$%',
databaseURL: 'https://instagramfirebase-!@#$%.firebaseio.com',
storageBucket: 'instagramfirebase-!@#$%.appspot.com',
credential: [Object] },
INTERNAL: FirebaseAppInternals { credential_: [Object], isDeleted_: false, tokenListeners_: [] } },
instance: 'https://instagramfirebase-!@#$%.firebaseio.com',
_path: '/following/8KCjOPXBsdM9LikaAcGQHKV4dDF3/NkMaql9RAhM4titj5hPJl68Q5zb2',
_data: 1 }
the _path variable has the correct info both uid and following followingId
i dont know why the wild card variables arent working