[英]Firebase functions : Cannot set property config of #<Object> which has only a getter
Firebase 功能运行良好我更新到最新的 firebase-tools 现在运行 firebase 服务时遇到此错误问题。
[debug] [2020-05-28T20:37:11.387Z] [runtime-status] [93658] Error in handleMessage: => TypeError: Cannot set property config of #<Object> which has only a getter: TypeError: Cannot set property config of #<Object> which has only a getter
at {....}/node/v10.15.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:455:19
at Generator.next (<anonymous>)
at fulfilled ({....}/node/v10.15.0/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:5:58)
[warn] ⚠ functions: Cannot set property config of #<Object> which has only a getter {"metadata":{"emulator":{"name":"functions"},"message":"Cannot set property config of #<Object> which has only a getter"}}
[warn] ⚠ Your function was killed because it raised an unhandled error. {"metadata":{"emulator":{"name":"functions"},"message":"Your function was killed because it raised an unhandled error."}}
我在尝试firebase serve
时遇到了同样的错误。 对我来说,解决方法只是使用npm install -g firebase-tools
-tools 将我的 firebase-tools 更新到最新版本。 最新的更新似乎已经解决了这个特殊问题。
编辑:修复在 firebase-tools 的 8.4.1 版本中发布
事实证明,这是在我将其发布到此处的同时提交并修复的: GitHub - firebase-tools - 无法设置只有 getter 的 # 的属性配置 #2301
修复应该很快在 8.4.1 中可用。
检查firebase-debug.log中的 firebase-tools 版本。 该错误已在firebase-tools: 8.4.1中修复。
[debug] [2020-10-08T09:42:11.364Z] CLI Version: 8.8.1
升级全局 firebase cli
npm i -g firebase-cli@8.12.0
检查您的 package.json 中的 firebase-cli 版本,如果低于 8.4.1,也请升级它。
npm i firebase-cli@8.12.0
运行firebase emulators:start并再次检查 cli 版本的 firebase -debug.log 。 它应该高于8.4.1
[debug] [2020-10-08T09:42:11.364Z] CLI Version: 8.8.1
只需将 firebase-functions 更新到 3.6.0
使用 NPM: npm i firebase-functions@3.6.0
使用纱线: yarn add firebase-functions@3.6.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.