У меня есть проект на угловом уровне, который, когда я пытаюсь собрать для производства, я получаю сообщение об ошибке «ОШИБКА в Превышен максимальный размер стека вызовов».
Приложение работает мягко в ng serve, ng test и ng lint даже в ng build. Эта ошибка появляется только в Ng Build --prod.
Я попытался проверить внедрение графических зависимостей, обнаружил, что иногда это цикл в зависимостях. В моем приложении только один модуль.
Вот ошибка:
ng build --prod
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Date: 2019-10-31T17:43:28.476Z
Hash: 06e7831299085acc0c0f
Time: 16349ms
chunk {0} runtime-es5.741402d1d47331ce975c.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main-es5.4af9b61479361f268d39.js (main) 128 bytes [initial] [rendered]
chunk {2} polyfills-es5.827748167125a43ef247.js (polyfills) 68 kB [initial] [rendered]
chunk {3} styles.3478e69dc6e394eaaf69.css (styles) 540 kB [initial] [rendered]
chunk {scripts} scripts.76d41fbab69877b36452.js (scripts) 173 kB [entry] [rendered]
ERROR in Maximum call stack size exceeded
вот мой пакет. Json:
{
"name": "firemaps",
"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": {
"@agm/core": "^1.0.0-beta.5",
"@agm/js-marker-clusterer": "^1.0.0-beta.5",
"@agm/snazzy-info-window": "^1.0.0-beta.5",
"@angular/animations": "^8.0.1",
"@angular/cdk": "^8.0.1",
"@angular/common": "^8.0.1",
"@angular/compiler": "^8.0.1",
"@angular/core": "^8.0.1",
"@angular/fire": "^5.2.1",
"@angular/forms": "^8.0.1",
"@angular/material": "^8.0.1",
"@angular/material-moment-adapter": "^8.1.4",
"@angular/platform-browser": "^8.0.1",
"@angular/platform-browser-dynamic": "^8.0.1",
"@angular/pwa": "^0.13.7",
"@angular/router": "^8.0.1",
"@angular/service-worker": "^8.0.1",
"@fortawesome/fontawesome-free": "^5.6.3",
"@progress/kendo-file-saver": "^1.0.7",
"@types/chart.js": "^2.7.40",
"@types/googlemaps": "^3.30.19",
"@types/hammerjs": "^2.0.36",
"@types/jquery": "^3.3.29",
"@types/uuid": "^3.4.5",
"@zxing/ngx-scanner": "^2.0.1",
"angular-bootstrap-datetimepicker": "^3.0.0",
"angular-bootstrap-md": "^7.5.3",
"animate.css": "^3.7.2",
"chart.js": "^2.7.2",
"core-js": "^2.5.4",
"datebook": "^2.0.3",
"file-saver": "^2.0.2",
"firebase": "^5.11.1",
"hammerjs": "^2.0.8",
"html2canvas": "^1.0.0-rc.3",
"install": "^0.13.0",
"js-marker-clusterer": "^1.0.0",
"jspdf": "^1.5.3",
"jszip": "^3.2.2",
"moment": "^2.24.0",
"ng-navigator-share": "^1.0.0",
"ngx-color-picker": "^8.1.0",
"ngx-qrcode2": "0.0.9",
"npm": "^6.12.1",
"rxjs": "^6.5.2",
"snazzy-info-window": "^1.1.0",
"stream": "0.0.2",
"tslib": "^1.9.0",
"uuid": "^3.3.3",
"uuid-generator-ts": "^1.0.3",
"zone.js": "^0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.800.0",
"@angular/cli": "^8.3.14",
"@angular/compiler-cli": "^8.0.1",
"@angular/language-service": "^8.0.1",
"@types/google.analytics": "0.0.40",
"@types/jasmine": "^2.8.8",
"@types/jasminewd2": "^2.0.3",
"@types/jspdf": "^1.3.0",
"@types/node": "^8.9.4",
"codelyzer": "^5.0.1",
"jasmine-core": "^2.99.1",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^3.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.0",
"ts-node": "^7.0.0",
"tslint": "^5.11.0",
"typescript": "^3.4.5"
}
}
Вот сборка без флага --prod
ng build
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Date: 2019-10-31T17:39:42.080Z
Hash: b92213c3069e829fc7ab
Time: 44187ms
chunk {firebase-messaging} firebase-messaging-es5.js, firebase-messaging-es5.js.map (firebase-messaging) 111 kB [rendered]
chunk {main} main-es5.js, main-es5.js.map (main) 2.91 MB [initial] [rendered]
chunk {polyfills} polyfills-es5.js, polyfills-es5.js.map (polyfills) 632 kB [initial] [rendered]
chunk {runtime} runtime-es5.js, runtime-es5.js.map (runtime) 8.79 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 407 kB [entry] [rendered]
chunk {styles} styles-es5.js, styles-es5.js.map (styles) 3.04 MB [initial] [rendered]
chunk {vendor} vendor-es5.js, vendor-es5.js.map (vendor) 12.8 MB [initial] [rendered]
Date: 2019-10-31T17:40:17.289Z
Hash: 6a51d8fdfce0bb1995aa
Time: 35075ms
chunk {firebase-messaging} firebase-messaging-es2015.js, firebase-messaging-es2015.js.map (firebase-messaging) 111 kB [rendered]
chunk {main} main-es2015.js, main-es2015.js.map (main) 2.82 MB [initial] [rendered]
chunk {polyfills} polyfills-es2015.js, polyfills-es2015.js.map (polyfills) 274 kB [initial] [rendered]
chunk {runtime} runtime-es2015.js, runtime-es2015.js.map (runtime) 8.79 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 407 kB [entry] [rendered]
chunk {styles} styles-es2015.js, styles-es2015.js.map (styles) 3.04 MB [initial] [rendered]
chunk {vendor} vendor-es2015.js, vendor-es2015.js.map (vendor) 12 MB [initial] [rendered]