You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Timestamp.fromDate(date) is broken with following error:
TypeError: Cannot read properties of undefined (reading 'fromDate')
at dateToTimestamp (/Users/fabienpatou/dev/plato-backend-firebase/functions/lib/utils/utils.js:129:61)
at /Users/fabienpatou/dev/plato-backend-firebase/functions/lib/B2BFunctions/Agenda/rejectCall.js:67:52
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/fabienpatou/dev/plato-backend-firebase/functions/node_modules/firebase-functions/lib/common/providers/https.js:407:26
at async runFunction (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:564:9)
at async runHTTPS (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:590:5)
at async handler (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:510:17)
Hey @fabienpatou you might want to import the Timestamp type from Firestore. Could you try adding import { Timestamp } from 'firebase-admin/firestore';? Thanks.
Reacted by sanxfxteam, ACouasnon_perso, Victor Dan-Jumbo Sodienye, Salvatore Starace and Luis Iturrios (Koy)
Activity
google-oss-bot commentedon Jul 4, 2022
I found a few problems with this issue:
lahirumaramba commentedon Jul 5, 2022
Hey @fabienpatou you might want to import the
Timestamptype from Firestore. Could you try addingimport { Timestamp } from 'firebase-admin/firestore';? Thanks.fabienpatou commentedon Jul 6, 2022
Thanks @lahirumaramba, it's working !
The following is not working:
import * as admin from "firebase-admin"; admin.firestore.Timestamp.fromDate(date);