angular - Angular 9:“为差异加载生成 ES5 包...”时出错:标识符直接在数字之后
问题描述
我刚刚将我的 Angular 项目从版本 8 更新到了 9。由于我必须支持 IE 11 浏览器,因此目标是“es5”。
更新后,“为差异加载生成 ES5 包...”时出现以下错误
[1m[31m发生未处理的异常:C:\myproject\polyfills-es5.9b276c87455e9832d96d.js: Identifier directly after number (1:354893)[39m[22m [1m[31m[39m[22m]
包.json
{
"name": "myproject",
"version": "0.0.0",
"private": true,
"dependencies": {
"@angular/animations": "^9.1.11",
"@angular/cdk": "^9.2.4",
"@angular/common": "^9.1.11",
"@angular/compiler": "^9.1.11",
"@angular/core": "^9.1.11",
"@angular/forms": "^9.1.11",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "^9.1.11",
"@angular/platform-browser-dynamic": "^9.1.11",
"@angular/router": "^9.1.11",
"@datorama/akita": "^5.1.1",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"angular-svg-round-progressbar": "^3.0.1",
"cronstrue": "^1.94.0",
"croppie": "^2.6.5",
"css-element-queries": "^1.2.3",
"highcharts": "^8.1.2",
"highcharts-angular": "^2.4.0",
"jquery": "^3.5.1",
"jquery-ui-dist": "^1.12.1",
"jquery-ui-touch-punch": "^0.2.3",
"lodash": "^4.17.15",
"ngx-infinite-scroll": "^9.0.0",
"rxjs": "^6.6.0",
"srcdoc-polyfill": "^1.0.0",
"stacktrace-js": "^2.0.2",
"tslib": "^2.0.0",
"web-animations-js": "^2.3.2",
"xlsx": "^0.16.3",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^9.2.0",
"@angular-devkit/build-angular": "^0.901.10",
"@angular/cli": "^9.1.10",
"@angular/compiler-cli": "^9.1.11",
"@angular/language-service": "^9.1.11",
"@asciidoctor/core": "^2.2.0",
"@asciidoctor/reveal.js": "^4.0.1",
"@cartant/tslint-config-rxjs": "^2.0.6",
"@datorama/akita-ngdevtools": "^5.0.3",
"@types/browser-sync": "^2.26.1",
"@types/ckeditor": "^0.0.46",
"@types/jquery": "^3.5.0",
"@types/jqueryui": "^1.12.13",
"@types/license-checker": "^25.0.0",
"@types/lodash": "^4.14.157",
"@types/node": "^14.0.14",
"@types/request": "^2.48.5",
"ajv": "^6.12.2",
"browser-sync": "^2.26.7",
"codelyzer": "^5.1.2",
"dependency-cruiser": "^9.8.0",
"license-checker": "^25.0.1",
"prettier": "^2.0.5",
"rxjs-tslint-rules": "^4.33.3",
"saml-idp": "^1.2.1",
"stylelint": "^13.6.1",
"stylelint-checkstyle-formatter": "^0.1.2",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-recommended": "^3.0.0",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.18.0",
"ts-node": "^8.10.2",
"tsc-silent": "^1.2.1",
"tslint": "^5.20.1",
"tslint-microsoft-contrib": "^6.2.0",
"tslint-sonarts": "^1.9.0",
"typescript": "~3.8.3",
"vega": "^5.13.0",
"vega-embed": "^6.9.0",
"vega-lite": "^4.13.1"
}
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "src",
"declaration": false,
"downlevelIteration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": [
"dom",
"es2020"
],
"module": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"strict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
“npm 过时”给出
任何提示解决方案可能是什么?
解决方案
我的项目也有同样的问题,我解决了将 outputHashing 设置为无(angular.json)的问题。有人有关于这个错误的消息吗?我在 github angular 项目上找不到任何问题,在网络上也找不到任何其他文章。
推荐阅读
- mysql - 如何从 Slick DB 连接到 MySQL 的 JDBC 连接中获取 max_allocated_packets
- android - 颤振闪屏不适用于launch_background.xml
- javascript - 用于 jQuery 的简易拆分布局插件 - 拆分器拖动事件未触发
- github - Azure Data Studio 无法向 github 进行身份验证
- oracle - 在月份对应的表空间中按月自动进行Oracle分区
- powerbi - 在 Power BI (DAX) 中实施二项式假设检验显着性检验
- python - LiveReload 异常:
- python - 如何对 numpy 数组进行采样,以使 c 列的平均值和标准值等于(尽可能接近)预定义的常量值?
- amazon-web-services - 使静态文件仅可供我在 AWS 或 Google Cloud 上托管的应用访问
- sql - pyodbc sql 语句不接受 nvarchar