regeneratorRuntime is not defined (Angular 6)


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/",
            "assets": [
            "styles": [
            "scripts": []


Using babel plugins :smiley:

yarn add babel-polyfill --dev


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


Where is this .babelrc file? shall i add it manually?


Make it in root directory


resolved here Error Integrating Adnoisjs websocket Client API with angular7


Ok. I found a solution.

First install the package

yarn add babel-polyfill --dev or npm add babel-polyfill --dev

Then require it in the angular.json

"scripts": ["node_modules/babel-polyfill/dist/polyfill.min.js"]

And… voyalà