RegeneratorRuntime is not defined

后端 未结 5 542
渐次进展
渐次进展 2020-12-14 15:10

I am trying to run Karma-babel-preprocessor and a straight forward ES6 generator:

//require(\'babel/polyfill\');

  describe(\"how Generators work\", functio         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 15:31

    If you use React, adding polyfills from create-react-app worked for me.

    yarn add --dev react-app-polyfill
    

    Then add the following lines to webpack.config.js

    entry: {
      app: [
        'react-app-polyfill/ie9', // Only if you want to support IE 9
        'react-app-polyfill/stable',
        './src/index.jsx',
      ],
    },
    

    See more examples on the react-app-polyfill GitHub page.

提交回复
热议问题