Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Saw ReferenceError: regeneratorRuntime is not defined when using async / await #141

Closed
joeyespo opened this issue Jul 11, 2017 · 2 comments

Comments

@joeyespo
Copy link

I read that adding "use latest" to your script would run the code through Babel, so I embraced modern JS from the get-go on a recent project. Really cool!

However, after deploying I saw ReferenceError: regeneratorRuntime is not defined error from using async / await. So instead of relying on the builtin Babel support, I ran it through Babel locally to test and deploy the result. Note that I'm not using --bundle since it's a simple script.

Looks like it's missing the regenerator runtime. I ended up working around this by running babel locally on my source and deploying that instead. Here's my .babelrc file:

{
  "presets": ["env"],
   "plugins": [
    ["transform-runtime", {
      "polyfill": false,
      "regenerator": true
    }]
  ]
}
@gaastonsr
Copy link

Thanks so much!

@NotMyself
Copy link

Hi Everyone,

Webtask.io now runs on Node 8 directly. Async/Away is supported. I am going to close this issue. Feel free to respond and reopen if you have any questions.

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

4 participants