I am getting the following error:
ReferenceError: regeneratorRuntime is not defined
and it is caused by
_asyncToGenerator(regeneratorRuntime.mark(function _callee() {
I have tried the methods in Babel 6 regeneratorRuntime is not defined with async/await and also RegeneratorRuntime is not defined, but have no luck.
My .babelrc is as below
{
"presets":["latest"]
}
I am able to solve the problem by add require('babel-polyfill') however this line will throw problem if I run it with babel-node during development time.
Anyone faced similar problem before?
Add babel-polyfill to your plugins in the .babelrc file:
{
"presets": [["es2016"]],
"plugins": ["syntax-async-functions","transform-regenerator","babel-polyfill"],
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With