functions-samples: delete-unused-accounts-cron : TypeError: functions.https.onRequest(...).then is not a function
How 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```
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- Fixed for realz :) #359 — committed to firebase/functions-samples by nicolasgarnier 6 years ago
You need to add
});
to line 70 ๐ After that itโs fixed