why can't I use async / await
See original GitHub issueIf I try to use syntax like async (req, res) => {...
in my firebase function I get the error below when deploying. I assume it’s a language feature that’s not supported yet?
error Parsing error: Unexpected token =>
Removing the async makes it go away…
However, I have a dependency in my package (ccxt) that does use the async / await syntax, and it works just fine. Why is this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Why I Don't Use Async Await - DEV Community
One in the particular is not using async await. A warning, this is a minority view, and only some functional languages hold this...
Read more >Cannot await on async method - Stack Overflow
As others have pointed out, await can only be used within an async method. However, you should not use async void !
Read more >Why You Can't Use Async/Await. It's a powerful ... - Michael Long
So having async/await in the language doesn't help you a lot if, for example, you can't call the async/await version of URLSession. dataTask...
Read more >Why I Don't Use Async Await – Software, Fitness, and Gaming
One in the particular is not using async await. A warning, this is a minority view, and only some functional languages hold this...
Read more >Async/await - The Modern JavaScript Tutorial
Let's emphasize: await literally suspends the function execution until the promise settles, and then resumes it with the promise result. That ...
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 Free
Top 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
If anybody else is continuing to receive this issue after doing the updates, make sure that
"ecmaVersion": 8
is set in your .eslintrc.json as well.async/await is only supported in the Node 8 runtime, which was only recently added as a beta runtime in firebase functions.
You can use it by adding the following to your package.json.
"engines": { "node": "8" },