Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Async/Await on Google Cloud

I'm trying to deploy a Webhook for Dialogflow in an Action-On-Google.

This Webhook is using Async/Await, so it needs NodeJS 8.x.

When I type "node --version" into my Google Cloud console (the one on cloud.google.com website), it shows me 8.5.0 as version of node.

But when I deploy the webhook script via "gcloud beta functions deploy", I get a "SyntaxError: Unexpected identifier" at the position of my script where the first "await" is used.

So is async/await disabled in the Google Cloud, even if it is using Node 8.5?

like image 942
MHilgers Avatar asked Mar 26 '26 21:03

MHilgers


1 Answers

Google Cloud Functions (aka Firebase Functions) only supports node 6.11.5 (see https://cloud.google.com/functions/docs/writing/ for details). Thus, you can only use language features supported up to that version of node.

like image 84
Austin Parker Avatar answered Mar 29 '26 17:03

Austin Parker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!