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 generators/iterators not supported #2984

Closed
fijiwebdesign opened this issue Mar 11, 2023 · 1 comment
Closed

async generators/iterators not supported #2984

fijiwebdesign opened this issue Mar 11, 2023 · 1 comment

Comments

@fijiwebdesign
Copy link

Using latest version. ^0.17.00

Will async generators and iterators be supported?

async function* foo() {
  yield 1;
  yield 2;
}

(async function() {
  for await (const num of foo()) {
    console.log(num);
    // Expected output: 1

    break; // Closes iterator, triggers return
  }
})();

Gives error:

✘ [ERROR] Transforming async generator functions to the configured target environment ("es2015") is not supported yet

    src/test.ts:33:4:
      33 │     async function* foo() {
         ╵     ~~~~~

✘ [ERROR] Transforming for-await loops to the configured target environment ("es2015") is not supported yet

    src/test.ts:39:10:
      39 │       for await (const num of foo()) {
         ╵           ~~~~~
@evanw
Copy link
Owner

evanw commented Mar 11, 2023

Closing as a duplicate of #2780. This is a known issue.

@evanw evanw closed this as completed Mar 11, 2023
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