New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: _onRequestWithOpts is not a function #1480
Comments
Experiencing the exact same issue. All was well day before yesterday. Thanks for posting this - I've been racking my brains trying to figure out what I've done wrong that would have broken my little project. Tried reverting to version 7.0.0 of firebase-tools but still got the same error. |
I've opened a PR to fix it, see #1482. |
I'm also running into this issue. |
Literally having the same issue. Tried just running the hello world program and gives the same error if using firebase serve. Good to know I'm not the only one. |
Thanks all for reporting and @merlinnot for the fix! That's what we get for relying on internal APIs |
anyone else getting an unexpected error, when trying to run firebase serve with the hello world program? |
Yes @mmillerscsu . First got this error last night. Was working on an existing project, so my first thought was: I screwed up something. A few hours later, I decided to create a project from scratch and that's when I noticed that even the helloWorld function on a brand new project gives the same errror on trying to run |
If you are experiencing this issue, the workaround is to run |
Thanks @samtstern Any ETA on when this will be fixed though? |
#1482 is already underway, this should be fixed by the end of the day. |
If anyone needs a quick fix for this issue, I just tried workaround suggested by @samtstern and |
@samtstern got it to work thanks! I will be using this temporarily until they update the fix. |
@mmillerscsu No I just ran |
@lcarbonaro got it to work now thanks. |
Thanks @samtstern for the workaround, that helped me. |
I tried installing
|
@lefnire Same error message? I have the same dependencies on my functions package.json but the only error that I got it was from grpc that made me update the node version to 10. |
@jheredia scratch that, I nuked node_modules & functions/node_modules tried again, all good |
Delete node_modules then run npm install, npm install firebase-admin and npm install firebase-functions@3.0.2 |
|
This has been fixed in firebase-tools 7.1.0
…On Fri, Jul 12, 2019, 7:08 AM João Paulo Vanzuita ***@***.***> wrote:
npm install ***@***.*** (not 3.0.2) worked for me
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1480?email_source=notifications&email_token=ACATB2R35JKIGQQKMZCMEF3P7CF67A5CNFSM4H7AWTV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZ3QRQ#issuecomment-510900294>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACATB2XJ6OQPGPUHO65FVADP7CF67ANCNFSM4H7AWTVQ>
.
|
no it hasnt been fixed |
Fixed it for me when i run |
|
Use node ver 8 fixed for me ;) |
Still not fixed on my side
back to
|
This appears to be working for me in |
got the same issue. @samtstern Is there any chance to see it fixed soon? |
@hyzhak this should be fixed in the latest release of |
For those running WSL 1 (linux on Windows 10), using firebase tools 7.10 or 7.2.2 to fix this issue might still be a problem, due to something in 7.10 causing a problem for WSL users: #1458. I run WSL 1 with firebase tools 7.0.2, node 10, and installing firebase-functions@3.0.2 fixed this problem for me. |
For me it was because firebase-tools was installed globally after upgrading to latest.
then update your scripts to to use npx equivalent commands.
https://twitter.com/leblancmeneses/status/1159349938331029504 |
Still with the same problemn, solved with firebase-functions@3.0.2 |
Worked with me:
|
here is what worked for me yesterday
|
Fixed in 4.15.1 |
[REQUIRED] Environment info
firebase-tools: 7.0.2
Platform: macOS
[REQUIRED] Test case
npm i -g firebase-tools@latest
ornpm i -D firebase-tools@latest
[REQUIRED] Steps to reproduce
Error encountered: TypeError: _onRequestWithOpts is not a function at Object.httpsProvider._onRequestWithOpts (in lib/emulator/functionsEmulatorRuntime.js)
firebase run serve
, and encountered the errorfirebase run serve
, and encountered the errorconst httpsProvider = require(httpsProviderResolution);
in the above file and the path outputted islib/providers/https
which does not exist.(Note: Functions local emulator worked prior to step #2 when I tried to update firebase-tools.)
[REQUIRED] Expected behavior
Run functions locally.
[REQUIRED] Actual behavior
functions: Emulator started at http://localhost:5000
i functions: Watching "/Users/joe/Server/my-project/functions" for Cloud Functions...
⚠ TypeError: _onRequestWithOpts is not a function
at Object.httpsProvider._onRequestWithOpts (/Users/joe/Server/my-project/functions/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:278:24)
at Object.httpsProvider.onRequest (/Users/joe/Server/my-project/functions/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:283:34)
at Object. (/Users/joe/Server/my-project/functions/index.js:18:38)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at /Users/joe/Server/my-project/functions/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:582:33
⚠ We were unable to load your functions code. (see above)
The text was updated successfully, but these errors were encountered: