regeneratorRuntime is not defined报错处理

Posted musiq66

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了regeneratorRuntime is not defined报错处理相关的知识,希望对你有一定的参考价值。

提示这个报错是因为使用了async/await等es7语法,需要babel进行转换

具体:(babel7)

$ yarn add @babel/runtime && yarn add --dev @babel/plugin-transform-runtime

并在.babelrc里面添加如下:


    ...,
    plugins: ['@babel/plugin-transform-runtime']

以上是关于regeneratorRuntime is not defined报错处理的主要内容,如果未能解决你的问题,请参考以下文章