美文网首页
微信小程序regeneratorRuntime is not d

微信小程序regeneratorRuntime is not d

作者: 被代码耽误的裁缝 | 来源:发表于2019-06-07 12:50 被阅读0次

起因:
小程序开启ES6转码后async函数无法使用
解决方案:npm install regenerator-runtime --save dev

然后会报另一个错,Function(...) is not a function,这是因为regenerator-runtime版本更新造成的,

继续解决方案:
删掉新增的try-catch语句,将第一行的var runtime改回var regeneratorRuntime即可。

解决方案参考自Xu_Cat 的博客

相关文章

网友评论

      本文标题:微信小程序regeneratorRuntime is not d

      本文链接:https://www.haomeiwen.com/subject/tlpmxctx.html