Sub*_*bbu 3 babeljs babel-polyfill angular
我创建了一个新的 angular 应用程序,通过将 dist 文件夹中的所有内容复制到 angular 应用程序的资产文件夹中并在 index.html 中引用它,我导入了一个 3rd 方应用程序 (svgedit)。现在我收到这个错误
未捕获的 ReferenceError:未定义 regeneratorRuntime
我已经搜索并看到了包含 babel-polyfill 等的建议,但一直无法解决这个问题。
这是我的设置,Angular 9.1.7
套餐
@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
Run Code Online (Sandbox Code Playgroud)
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"
}
}
Run Code Online (Sandbox Code Playgroud)
小智 5
当我在我的 angular 应用程序中使用 contentful 时,我遇到了同样的错误。您可以将这些行添加到您的 app.component 中:
import "core-js/stable";
import "regenerator-runtime/runtime";
Run Code Online (Sandbox Code Playgroud)
我在这里找到它:https : //github.com/zloirock/core-js#babelpolyfill
| 归档时间: |
|
| 查看次数: |
1214 次 |
| 最近记录: |