我刚从8版升级到9版,因为我必须支持IE11浏览器,目标是"es5“。
在更新之后,我得到了以下错误,同时“生成用于差异加载的ES5包.”
[1M[31 31m未处理异常发生: C:\myproject\polyfills-es5.9b276c87455e9832d96d.js:标识符直接位于数字(1:354893)后][39m][22m][1M][31m[39m[22m]]
package.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
}“国家预防机制过时”
有什么提示吗?
发布于 2020-07-06 12:32:45
一些补充资料:
polyfills-es5.<some hash value>.js在末尾包含自己的文件名,作为JavaScript表达式。下面是文件的结尾(注意第1行的末尾,而不是第2行的注释)
{preventExtensions:function(t){return c&&o(t)?c(i(t)):t}})}},[[4,0]]]),polyfills,es5.e52fb6e508fabacaf778.js;
//# sourceMappingURL=polyfills-es5.e52fb6e508fabacaf778.js.map只有当哈希值以数字开头时,才会发生编译错误。
在sourceMap: false中设置angular.json似乎可以防止错误,在这种情况下不生成包含文件名的表达式。
发布于 2020-07-30 06:33:20
在我的项目中,我也解决了将outputHashing设置为none (angular.json)的问题。有人知道这个错误的消息吗?我在github角项目上找不到任何问题,也没有在网上找到任何其他文章。
https://stackoverflow.com/questions/62696428
复制相似问题