云功能:无法读取未定义的属性“名称”

时间:2018-12-15 14:12:49

标签: google-cloud-firestore google-cloud-functions firebase-admin

当我收听onWrite事件时,有时但经常出现Google Cloud Functions错误。

TypeError: Cannot read property 'name' of undefined
    at Firestore.snapshot_ (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/build/src/index.js:422:127)
    at beforeSnapshotConstructor (/user_code/node_modules/firebase-functions/lib/providers/firestore.js:140:30)
    at changeConstructor (/user_code/node_modules/firebase-functions/lib/providers/firestore.js:144:49)
    at cloudFunctionNewSignature (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:104:28)
    at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:135:20)
    at /var/tmp/worker/worker.js:768:24
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

如您所见,问题至少在日志跟踪中与我的代码无关。

我在该功能的顶部设置了控制台日志,但似乎该功能甚至无法启动。

"dependencies": {
    "cors": "^2.8.5",
    "express": "^4.16.4",
    "firebase-admin": "~6.0.0",
    "firebase-functions": "^2.1.0",
    "lodash": "^4.17.11"
  },

请对此错误提供任何解决方案或其来源指南?

0 个答案:

没有答案