Can't test cloud functions locally, emulator fails to start with TypeError: _onRequestWithOpts is not a function

放肆的年华 提交于 2019-12-05 00:41:29

If you are experiencing this error, run npm install firebase-functions@3.0.2 in your functions directory.

This will be fixed soon, and you can follow along here: https://github.com/firebase/firebase-tools/issues/1480

I found error in:

node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js

line 276:

const _onRequestWithOpts = httpsProvider._onRequestWithOpts;

should be:

const _onRequestWithOpts = httpsProvider._onRequestWithOptions;

Downgrade firebasefunction to version 3.0.0

Delete node_modules then run npm install, npm install firebase-admin and npm install firebase-functions@3.0.2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!