regeneratorRuntime is not defined (how keep babel from including that polyfill?)

This appears to be a bug in the parcel js bundler.

https://github.com/babel/babel/issues/9971


If you want to use async, await with (ES6 or ES Next) then you must need to install @babel/polyfill but you don't need to write anything in babelrc file. Just install npm install --save @babel/polyfill

From the documentation:

Because this is a polyfill (which will run before your source code), we need it to be a dependency, not a devDependency

And finally you need to import @bable/polyfill in your mainJS (App.js) file like:

import "@babel/polyfill";

Tags:

Babeljs