question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: _onRequestWithOpts is not a function

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 7.0.2

Platform: macOS

[REQUIRED] Test case

npm i -g firebase-tools@latest or npm 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)

  1. Init a new project with Firebase init, choose location, and set up functions in the dashboard
  2. Updated global package, ran firebase run serve, and encountered the error
  3. Deleted the global package, installed locally to project, ran firebase run serve, and encountered the error
  4. Console logged const httpsProvider = require(httpsProviderResolution); in the above file and the path outputted is lib/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.<anonymous> (/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)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:35 (6 by maintainers)

github_iconTop GitHub Comments

46reactions
samtsterncommented, Jul 9, 2019

If you are experiencing this issue, the workaround is to run npm install firebase-functions@3.0.2 in your functions directory.

8reactions
merlinnotcommented, Jul 9, 2019

I’ve opened a PR to fix it, see #1482.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: _onRequestWithOpts is not a function at Object ...
I'm creating an app that uses firebase-functions. I created my app directory and ran firebase init. After that was completed I tried to...
Read more >
Uncaught TypeError: Sine.easeInOut.getRatio is not a function
I have getting the following error in console. Uncaught TypeError: Sine.easeInOut.getRatio is not a function. Anyone can help please?
Read more >
typescript — Impossible de tester les fonctions cloud localement, l ...
functions : Emulator started at http://localhost:5001 ⚠ TypeError: _onRequestWithOpts is not a function at Object.httpsProvider.
Read more >
[Firebase] Cloud Functions を開発デプロイする方法入門
Hosting も同時に起動したりしたい場合は firebase serve でいいと思います。 エラー: onRequestWithOpts is not a function. TypeError: ...
Read more >
This.$firebase.storage is not a function - Get Help - Vue Forum
Hi I've added this code to my main.js file. import firebase from 'firebase/app'; import 'firebase/firestore'; const config = { apiKey: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found