regeneratorRuntime is not defined (Angular 6)


#1

First path:

import Ws from '@adonisjs/websocket-client'

In this post (link here), the solution is change the order of imports. How to do it in Angular 6?

"build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/ng-sace",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.css"
            ],
            "scripts": []
          }
        }

#2

Using babel plugins :smiley:

yarn add babel-polyfill --dev

.babelrc

{
  "plugins": ["@babel/plugin-transform-regenerator"]
}