Visitar URL original
Angular 13 Project not loading some pages when production build deployed (ng build --configuration production) · Issue #22568 · angular/angular-cli · GitHub
The Wayback Machine - https://web.archive.org/web/20260114104200/https://github.com/angular/angular-cli/issues/22568
Skip to content

Angular 13 Project not loading some pages when production build deployed (ng build --configuration production)  #22568

@samidharane

Description

@samidharane

I have migrated our Angular project from 5.2 to 13. The migration went smooth and ng build / ng serve works well like it did before.

The real problem, where I don't know how to start working on it, is after I build the app for production (ng build --configuration production). The landing page of the project is completely blank, no JS errors, no console warnings.

Any relevant experience you might have in the past will help me, thanks a lot!

Package.json

{
"name": "app1",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --configuration production",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build-prod": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration production"
},
"private": true,
"dependencies": {
"@angular/animations": "^13.0.0",
"@angular/cdk": "^13.0.2",
"@angular/common": "^13.0.0",
"@angular/compiler": "^13.0.0",
"@angular/core": "^13.0.2",
"@angular/forms": "^13.0.0",
"@angular/material": "^13.0.2",
"@angular/platform-browser": "^13.0.0",
"@angular/platform-browser-dynamic": "^13.0.0",
"@angular/router": "^13.0.0",
"@ckeditor/ckeditor5-angular": "^1.0.1",
"@ckeditor/ckeditor5-build-classic": "^11.2.0",
"@ng-select/ng-select": "^8.1.1",
"@progress/kendo-angular-buttons": "^5.5.2",
"@progress/kendo-angular-common": "^2.0.2",
"@progress/kendo-angular-dateinputs": "^4.4.1",
"@progress/kendo-angular-dropdowns": "^4.4.1",
"@progress/kendo-angular-excel-export": "^3.1.6",
"@progress/kendo-angular-grid": "^5.4.3",
"@progress/kendo-angular-inputs": "^6.7.4",
"@progress/kendo-angular-intl": "^2.0.4",
"@progress/kendo-angular-l10n": "^2.0.3",
"@progress/kendo-angular-label": "^3.1.1",
"@progress/kendo-angular-pdf-export": "^3.0.2",
"@progress/kendo-angular-popup": "^4.0.2",
"@progress/kendo-angular-treeview": "^4.3.2",
"@progress/kendo-data-query": "^1.2.0",
"@progress/kendo-drawing": "^1.5.1",
"@progress/kendo-licensing": "^1.2.1",
"applicationinsights-js": "^1.0.19",
"core-js": "^3.19.1",
"js2xmlparser": "^4.0.0",
"ng-drag-drop": "^5.0.0",
"path-parse": "^1.0.7",
"rxjs": "^7.4.0",
"rxjs-compat": "^6.6.7",
"rxjs-tslint": "^0.1.8",
"stream": "0.0.2",
"timers": "^0.1.1",
"tslib": "^2.3.1",
"xml2js": "^0.4.23",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.0.1",
"@angular/cli": "^13.0.3",
"@angular/compiler-cli": "^13.0.0",
"@angular/language-service": "^13.0.0",
"@angular/localize": "^13.0.0",
"@types/applicationinsights-js": "^1.0.6",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^16.11.7",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.8",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"node-sass": "^4.12.0",
"ts-node": "~4.1.0",
"tslint": "~6.1.0",
"typescript": "~4.4.4"
}
}
angular-cli.json

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "app1"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app1",
"styles": [
"styles.css",
"sky.theme.css",
"modal.less"
],

"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "/node_modules/"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "/node_modules/"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "/node_modules/"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
tsconfig.json

{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"experimentalDecorators": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"module": "esnext",
"baseUrl": "./"
}
}

Reproduction Steps:

  1. Have project with packages mentioned above - have mentioned all packaged version used in project
  2. Build project with "ng build" / run project with ng serve everything works fine
  3. When we deploy build created using "ng build --configuration production" its not loading some pages

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions