require firebase-functions throws UnhandledPromiseRejectionWarning #311
Description
Environment details
- OS: MacOS Mojav 10.14.3
- Node.js version: v11.8.0
- npm version: 6.8.0
- @google-cloud/functions-emulator version: 1.0.0-beta.5
Steps to reproduce
- Create a file as such
const functions = require('firebase-functions'); exports.helloWorld = (req, res) => res.send("Hello, World!");
and comment the require functions. - deploy
functions start && functions deploy helloWorld --trigger-http
-> deploy successful. - un-comment the require functions
- deploy
functions start && functions deploy helloWorld --trigger-http
-> deploy Fails. throws an error
Warning: You're using Node.js v11.8.0 but the Google Cloud Functions runtime is only available in Node.js 6 and Node.js 8. Therefore, results from running emulated functions may not match production behavior.
Copying file:///var/folders/5z/r24zhntn759gj_m8ywv_m0tr0000gn/T/tmp-9639ai20X1swzyN3.zip...
Waiting for operation to finish...done.
Deploying function......(node:9640) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:8008
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1083:14)
(node:9640) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9640) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.