2.X async 报错



  • 已添加配置
    babel: {
    sourceMap: true,
    presets: [['env', { modules: false }]],
    plugins: [
    'transform-decorators-legacy',
    'transform-class-properties',
    'transform-object-rest-spread',
    ['transform-runtime', {
    "helpers": false,
    "polyfill": false,
    "regenerator": true,
    "moduleName": 'babel-runtime'
    }]
    ]
    },

    报错
    thirdScriptError
    Function(...) is not a function



  • 在node_modules中找到node_modules/regenerator-runtime下的runtime.js,删除最后一个try...catch,开头的var runtime = 改为 var regeneratorRuntime =

    config/index.js

    babel:{
    plugins: [
    'transform-decorators-legacy',
    'transform-class-properties',
    'transform-object-rest-spread',
    ['transform-runtime', {
    "helpers": false,
    "polyfill": false,
    "regenerator": true,
    "moduleName": 'babel-runtime'
    }]
    ]
    }


登录后回复