Nested arrow async functions
See original GitHub issuevar a = async () => {
return await (async () => {
return await b();
})();
};
It can’t parse this. It seems the syntax is OK.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Array data gets lost in nested async arrow function loop
It just merrily continues through its loop and you log the value of courses and then sometime later, all the await operations inside...
Read more >Arrow function expressions - JavaScript - MDN Web Docs
Syntax. Arrow functions can be async by prefixing the expression with the async keyword.
Read more >41 Async functions - Exploring JS
An asynchronous function is any function that delivers its result asynchronously – for example, a callback-based function or a Promise-based function. An async ......
Read more >Exploring Async/Await Functions in JavaScript - DigitalOcean
In this post we're quickly going over the ins and outs of async/await functions; introduced with ES2017 to help write synchronous-looking ...
Read more >Deeply Understanding JavaScript Async and Await with ...
In the case of arrow function, async is put after the = sign and before the parentheses. Async functions can also be put...
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
I get the same
unknown expression of type...
error even when not using nested async functions, sometimes just having an arrow function in an async function is enough to give that same error from babel. It also doesn’t give you a line number, just the file. Pretty serious bug.I’m having this issue at the moment using:
node: 6.9.3
npm: 4.1.1
webpack: 2
+babel-preset-env
+stage-0
But only on a windows machine. On a linux machine no problems compiling.
Edit: I had everything installed using
npm install
howeveryarn
was also available and after runningyarn
the issue was resolved. I’m assuming an older version of one of the dependencies was still present.