I'm using node version 10.15.3, npm version 6.9.0, VS code, and firebase-functions version 2.2.0 on a windows pc. Adding async/await to my app.post() function causes this:
 Function failed on loading user code. Error message: Code in file 
 index.js can't be loaded.
 Is there a syntax error in your code?
 Detailed stack trace: /user_code/index.js:31
 app.post('/pay-now', async (req, res) => {
                       ^
 SyntaxError: Unexpected token (
     at createScript (vm.js:56:10)
     at Object.runInThisContext (vm.js:97:10)
     at Module._compile (module.js:549:28)
     at Object.Module._extensions..js (module.js:586:10)
     at Module.load (module.js:494:32)
     at tryModuleLoad (module.js:453:12)
     at Function.Module._load (module.js:445:3)
     at Module.require (module.js:504:17)
     at require (internal/module.js:20:19)
     at getUserFunction (/var/tmp/worker/worker.js:439:24)
Here's my app.post():
app.post('/pay-now', async (req, res) => {
    // charge user's card
    const charge = await makeCharge(req, res)
    // store order info in database, returns address of order
    const address = await storeOrder(req, res, charge.id)
    // send email to customer
    await emailHandler.sendCustomerEmail(req, res)
    // send email to company letting them know they have a new order
    await emailHandler.sendLTEmail(req, res, address, true)
    return res.sendStatus(200)
})
I tried removing the async & await's in app.post(), but then I get the same error at the first use of async in the function makeCharge. Any idea on what could be wrong?
 
     
     
    