升级到Angular 8:将目标更改为";es2015“;tsconfig.json中的错误导致polyfills-2015中出现错误
将目标更改为es2015(而不是es5)时,我在启动应用程序时出现以下错误:升级到Angular 8:将目标更改为";es2015“;tsconfig.json中的错误导致polyfills-2015中出现错误,angular,ecmascript-6,polyfills,Angular,Ecmascript 6,Polyfills,将目标更改为es2015(而不是es5)时,我在启动应用程序时出现以下错误: polyfills-es2015.4a168e5d0734802f67ed.js:1 Uncaught TypeError: Cannot set property 'true' of undefined at Object.6dTf (polyfills-es2015.4a168e5d0734802f67ed.js:1) at u (runtime-es2015.05393c8efcd0eb15877
polyfills-es2015.4a168e5d0734802f67ed.js:1 Uncaught TypeError: Cannot set property 'true' of undefined
at Object.6dTf (polyfills-es2015.4a168e5d0734802f67ed.js:1)
at u (runtime-es2015.05393c8efcd0eb158773.js:1)
at Module.hN/g (polyfills-es2015.4a168e5d0734802f67ed.js:1)
at u (runtime-es2015.05393c8efcd0eb158773.js:1)
at Object.1 (polyfills-es2015.4a168e5d0734802f67ed.js:1)
at u (runtime-es2015.05393c8efcd0eb158773.js:1)
at t (runtime-es2015.05393c8efcd0eb158773.js:1)
at Array.r [as push] (runtime-es2015.05393c8efcd0eb158773.js:1)
at polyfills-es2015.4a168e5d0734802f67ed.js:1
另外,我需要在main.ts文件中导入Zone.js,而不是polyfills.ts,否则会出现错误:
在此配置中,angular需要zone.js
我使用的是Angular8、Typescript 3.4.5和node 12.4.0。我做错了什么
Mytsconfig.json:
{
"angularCompilerOptions": {
"preserveWhitespaces": false
},
"compileOnSave": false,
"exclude": [
"test.ts",
"**/*.spec.ts"
],
"compilerOptions": {
"outDir": "./dist/out-tsc/app",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"module": "esnext",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es6",
"dom"
],
"baseUrl": "./src"
}
}
问题来自web动画js 从Angular 6开始,不再需要它: 我们已经更新了动画的实现,不再需要 网页动画。这意味着您可以删除此多边形填充 从您的应用程序中,并保存大约47KB的捆绑包大小, 同时提高Safari中的动画性能 我从polyfills和我的package.json中删除了它,错误消失了