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

TypeScript Language Service (via VS Code) reports error using async in non-ES2015 target #9587

Closed
bytenik opened this issue Jul 9, 2016 · 3 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@bytenik
Copy link

bytenik commented Jul 9, 2016

Despite the fact that the code compiles successfully, the language service in 2.0.0-dev.20160707 is reporting (via VS Code in my instance) an error whenever a function is declared async when targeting < ES2015:

image

VS Code is successfully using the correct 2.0 preview:

image

I can post this to the VS Code issue tracker if more appropriate, but I'm pretty sure these errors come from the TS language service.

@yortus
Copy link
Contributor

yortus commented Jul 10, 2016

I think the language service error is correct, since TSC does not yet support async functions for non-es2015 targets. But until recently it didn't report an error in some cases (see #7334). This was fixed recently, and your language service is recent enough to have this fix, but I suspect the version you are compiling with is older. If you look at the emitted code for async functions, you might see they are not emitted correctly (see #7706).

@bytenik
Copy link
Author

bytenik commented Jul 10, 2016

I know that TSC didn't support it until recently, but that's actually what caused me to upgrade to 2.0 prerelease.

What would cause it to think I'm using an older compiler? I'll admit I fire the compiler off using gulp rather than tsc, but I did both a global and project-local install of typescript@next which is what caused Code to show the new version in the corner.

@yortus
Copy link
Contributor

yortus commented Jul 11, 2016

I know that TSC didn't support it until recently, but that's actually what caused me to upgrade to 2.0 prerelease.

The latest prerelease still doesn't support async functions in ES3/5, that hasn't been merged yet. #1564 is still open and looks like the last feature yet to land before 2.0 is ready for release.

I fire the compiler off using gulp

Perhaps gulp has it's own dependency on tsc v1.8? I would be installed somewhere like proj/node_modules/gulp-typescript/node_modules/typescript/.

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Jul 11, 2016
@mhegazy mhegazy closed this as completed Jul 11, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants