Base Href not applied Angular version 13 404 not found ,bundled js not found

91 views Asked by At

i have recently update my angular version from 6 to 13

Now am using the following to run my app npm version: 6.14.8 node version: v14.15.0 "@angular/cli": "~13.3.11"

however am encountering the following issue on

   GET http://localhost/styles.145f1b1ba0f28c3a.css net::ERR_ABORTED 404 (Not Found)
app-api:1 


        GET http://localhost/runtime.75392b82545ffc5e.js net::ERR_ABORTED 404 (Not Found)
app-api:1 


        GET http://localhost/polyfills.d9b53c4ae24b9955.js net::ERR_ABORTED 404 (Not Found)
app-api:1 


        GET http://localhost/main.10c794d315786578.js net::ERR_ABORTED 404 (Not Found)

In my angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "my-dashboard": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "../app-api/app-api/dist",
            "baseHref": "/",
            "aot": true,
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "inlineStyleLanguage": "scss",
            "preserveSymlinks": true,
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ],
                "optimization": {
                "scripts": true,
                "styles": {
                  "minify": true,
                  "inlineCritical": false
                },
                "fonts": true
              },
              "outputHashing": "all",
              "sourceMap": false,
              "extractLicenses": false,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
              },
            "development": {
                  "budgets": [
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ],
              "optimization": false,
              "outputHashing": "all",
              "sourceMap": true,
              "aot": true,
              "extractLicenses": false,
              "progress": false,
              "vendorChunk": true,
              "buildOptimizer": false,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }            
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "my-dashboard:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "my-dashboard:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "my-dashboard:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "src/styles.scss"
            ],
            "scripts": [],
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ]
          }
        },
        "lint": {
          "builder": "@angular-eslint/builder:lint",
          "options": {
            "lintFilePatterns": [
              "src/**/*.ts",
              "src/**/*.html"
            ]
          }
        }
      }
    },
    "my-dashboard-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "my-dashboard:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "my-dashboard:serve:production"
            }
          }
        }
      }
    }
  },
  "defaultProject": "my-dashboard",
  "cli": {
    "defaultCollection": "@angular-eslint/schematics"
  }
}

When i deployed the app on azure , the baseURl is not applied , it keeps without adding the base url . thank you for your responses

0

There are 0 answers