Babel 6 regeneratorRuntime is not defined

前端 未结 30 1907
暖寄归人
暖寄归人 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:10

    I had a setup
    with webpack using presets: ['es2015', 'stage-0']
    and mocha that was running tests compiled by webpack.

    To make my async/await in tests work all I had to do is use mocha with the --require babel-polyfill option:

    mocha --require babel-polyfill
    

提交回复
热议问题