Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

for await in plugin-standard-pkg #99

Open
dy opened this issue Oct 24, 2019 · 2 comments
Open

for await in plugin-standard-pkg #99

dy opened this issue Oct 24, 2019 · 2 comments

Comments

@dy
Copy link

dy commented Oct 24, 2019

Getting the following error in attempt to build pika:

[3/9] Running @pika/plugin-standard-pkg...
SyntaxError: C:\projects\spect\src\any.js: Unexpected token, expected "(" (15:8)

  13 |
  14 |   args.forEach(input => {
> 15 |     for await (const value of input) {
     |         ^
  16 |
  17 |     }
  18 |   })

Is there any way to work that around?

@dy
Copy link
Author

dy commented Oct 24, 2019

Adding .babelrc:

{
  "plugins": [
    "@babel/plugin-syntax-async-generators",
    "@babel/plugin-proposal-async-generator-functions"
  ]
}

doesn't help.
It seems to ignore .babelrc at all.

@FredKSchott
Copy link
Owner

Hmm, you definitely should be able to use it via your own custom babelrc, like in the example above.

We wouldn't support this in @pika/plugin-standard-pkg directly, since this is still proposed syntax and hasn't yet been added to the language spec (see https://tc39.es/proposal-async-iteration/)

I actually can reproduce this but even when running babel.loadOptions() directly in a directory with a .babelrc file. I was able to fix this by renaming my .babelrc to babel.config.json. Try that and let me know if that works.

Has .babelrc been deprecated in favor of the newer babel.config.json? If so, we can add a warning message to help.

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

No branches or pull requests

2 participants