背景
移动端H5应用调用后台接口用async/await方式时,浏览器报regeneratorRuntime is not defined
原因
When your app have added transform-runtime plugin it also added a require statement babel-runtime/regenerator.
解决方案
In my case installing babel-plugin-transform-runtime solved my issues
npm install --save-dev babel-plugin-transform-runtime
Then in .babelrc
{
“plugins”: [
[“transform-runtime”, {
“polyfill”: false,
“regenerator”: true
}]
]
}