delete-unused-accounts-cron : TypeError: functions.https.onRequest(...).then is not a function
See original GitHub issueHow to reproduce these conditions
Follow the readme :
- Create a Firebase Project using the Firebase Developer Console
- Download this sample e.g. git clone https://github.com/firebase/functions-samples
- Enter the sample directory cd functions-samples/delete-unused-accounts-cron
- Setup the sample with your project firebase use --add and follow the instructions.
- Install node dependencies of your Functions cd functions; npm install; cd -
- Deploy your project using firebase deploy.
Debug output
=== Deploying to 'project'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
+ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error occurred while parsing your function triggers.
TypeError: functions.https.onRequest(...).then is not a function
at Object.<anonymous> (functions-samples\delete-unused-accounts-cron\functions\index.js:47:4)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\triggerParser.js:18:11
at Object.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\triggerParser.js:38:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:508:3```
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
functions.https is not a function - firebase - Stack Overflow
Found the problem, it's a typo in the documentation. Should be: exports.helloWorld = functions.https.onRequest((request, response) ...
Read more >TypeError: _onRequestWithOpts is not a function #1480 - GitHub
If you are experiencing this issue, the workaround is to run npm install firebase-functions@3.0.2 in your functions directory. 37
Read more >Manage functions | Cloud Functions for Firebase - Google
Manage functions · On this page · Deploy functions · Delete functions · Modify a function's name, region or trigger. Rename a function;...
Read more >How to use the firebase-functions.runWith function in ... - Snyk
To help you get started, we've selected a few firebase-functions.runWith examples, based on popular ... onRequest(app); exports.version = functions.https.
Read more >getAllUsers not working in firebase functions - Google Groups
TypeError : admin.auth(...).listUsers is not a function at exports.getUsers.functions.https.onRequest (/user_code/users.js:29:22)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to add
});
to line 70 😉 After that it’s fixedI was using the GitHub online editor as I was on the go and thought the changes were simple enough (obviously that was a bad idea). I’ll be able to to test this soon.
I just pushed this fix (still untested) I can test in a couple hours but if you want to try go ahead (we should be getting there 😃
btw when you see something you could fix feel free to send a Pull Request. You can simply click on the edit icon in GitHub to quickly create a PR:
😃