微信小程序regeneratorRuntime is not d
2019-06-07 本文已影响0人
被代码耽误的裁缝
起因:
小程序开启ES6转码后async函数无法使用
解决方案:npm install regenerator-runtime --save dev
然后会报另一个错,Function(...) is not a function,这是因为regenerator-runtime版本更新造成的,
继续解决方案:
删掉新增的try-catch语句,将第一行的var runtime改回var regeneratorRuntime即可。
解决方案参考自Xu_Cat 的博客