How can I solve the error ‘TS2532: Object is possibly ‘undefined’?
I’m trying to rebuild a web app example that uses Firebase Cloud Functions and Firestore. When deploying a function I get the following error: src/index.ts:45:18 – error TS2532: Object is possibly ‘undefined’. 45 const data = change.after.data(); This is the function: export const archiveChat = functions.firestore .document(“chats/{chatId}”) .onUpdate(change => { const data = change.after.data(); const … Read more