I am looking to deploy my code to heroku, but i was always getting the error while building my angular application. I have tried using below commands to build my angular project. 'ng build --prod','ng build --aot --prod' Both the commands are resulting in same error . ng build --aot --prod click to view the error
attaching my package.json,added screenshot for package-lock.json. packagelock.json packagelock
{
"name": "blog-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"postinstall": "ng build --output-path angularapp --aot --prod"
},
"e2e": "ng e2e",
"private": true,
"dependencies": {
"@angular/animations": "^9.1.9",
"@angular/cli": "~9.1.6",
"@angular/common": "~9.1.7",
"@angular/compiler": "~9.1.7",
"@angular/compiler-cli": "~9.1.7",
"@angular/core": "~9.1.7",
"@angular/forms": "~9.1.7",
"@angular/platform-browser": "~9.1.7",
"@angular/platform-browser-dynamic": "~9.1.7",
"@angular/router": "~9.1.7",
"bootstrap": "^4.5.0",
"express": "^4.17.1",
"jquery": "^3.5.1",
"ngx-toastr": "^12.0.1",
"path": "^0.12.7",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"typescript": "~3.8.3",
"zone.js": "~0.10.2"
},
"devDependencies": {
"bootstrap": "^4.5.0",
"@angular-devkit/build-angular": "~0.901.6",
"@angular/cli": "~9.1.6",
"@angular/compiler-cli": "~9.1.7",
"@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": "~5.0.0",
"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"
},
"engines": {
"node": "v12.16.3",
"npm": "6.14.4"
}
}
PLease help
Issue was resolved when i use below command to build angular application
build --prod --named-chunks --verbose --build-optimizer=false --source-map
It pointed out where there is a syntactical through out the application. My build is successful once it is resolved