4

I created a new angular app, where I imported a 3rd party app (svgedit) by copying all the contents in dist folder into the angular app's assets folder and referenced it in the index.html. Now i get this error

Uncaught ReferenceError: regeneratorRuntime is not defined

I have searched and seen recommendations to include babel-polyfill etc, but haven't been able to solve this.

This is my setup, Angular 9.1.7

Packages

@angular-devkit/architect         0.901.7
@angular-devkit/build-angular     0.901.7
@angular-devkit/build-optimizer   0.901.7
@angular-devkit/build-webpack     0.901.7 
@angular-devkit/core              9.1.7
@angular-devkit/schematics        9.1.7
@angular/cli                      9.1.7
@ngtools/webpack                  9.1.7
@schematics/angular               9.1.7
@schematics/update                0.901.7
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0

package.json:

{
  "name": "scada",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.1.0",
    "@angular/common": "~9.1.0",
    "@angular/compiler": "~9.1.0",
    "@angular/core": "~9.1.0",
    "@angular/forms": "~9.1.0",
    "@angular/platform-browser": "~9.1.0",
    "@angular/platform-browser-dynamic": "~9.1.0",
    "@angular/router": "~9.1.0",
    "@babel/polyfill": "^7.10.1",
    "jquery": "^3.5.1",
    "rxjs": "~6.5.4",
    "svgedit": "^5.1.0",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.901.0",
    "@angular/cli": "~9.1.0",
    "@angular/compiler-cli": "~9.1.0",
    "@angular/language-service": "~9.1.0",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3"
  }
}
Neurotransmitter
  • 6,289
  • 2
  • 51
  • 38
Subbu
  • 588
  • 1
  • 7
  • 18

1 Answers1

6

I had the same error when I used contentful in my angular app. You can add these lines to your app.component:

import "core-js/stable";
import "regenerator-runtime/runtime";

I found it here: https://github.com/zloirock/core-js#babelpolyfill

Aldous Galay
  • 69
  • 1
  • 3