Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async/await with ES6/ES2015 target #137

Closed
floydspace opened this issue May 23, 2020 · 3 comments
Closed

async/await with ES6/ES2015 target #137

floydspace opened this issue May 23, 2020 · 3 comments

Comments

@floydspace
Copy link
Contributor

Hi @evanw, could you please explain how can I use async/await when compiling TypeScript to target ES6/ES2015?
I expect that it will compile replacing async/await with Promise, but instead I see it as it is and the following warning:

warning: This syntax is from ES2017 and is not available in ES2015
            async function toModel(item) {

Thank you.

@evanw
Copy link
Owner

evanw commented May 24, 2020

The transforms for all syntax features haven't been written yet. There is not yet code to transform async functions into older JavaScript. That is what this warning is about, and why async functions are documented as unsupported below ES2017. I plan to add support for transforming pretty much all of the syntax that's currently supported at some point in the future.

@floydspace
Copy link
Contributor Author

oh didn't catch this in the readme, thank you

@evanw evanw closed this as completed in 2f13113 Jun 21, 2020
@evanw
Copy link
Owner

evanw commented Jun 21, 2020

This should work as of esbuild version 0.5.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants