Babel 6 regeneratorRuntime is not defined

前端 未结 30 2269
暖寄归人
暖寄归人 2020-11-22 03:49

I\'m trying to use async, await from scratch on Babel 6, but I\'m getting regeneratorRuntime is not defined.

.babelrc file

{
    \"presets\": [ \"es2         


        
30条回答
  •  执笔经年
    2020-11-22 04:14

    If you using Gulp + Babel for a frontend you need to use babel-polyfill

    npm install babel-polyfill

    and then add a script tag to index.html above all other script tags and reference babel-polyfill from node_modules

提交回复
热议问题