1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

angular.json-> Property buildTarget is not allowed

Discussão em 'Angular' iniciado por naresh mesineni, Julho 9, 2025.

  1. I have migrated to Angular 17 using the migration tool. Everything works fine. But my angular.json shows a warning "Property buildTarget is not allowed."

    Before, browserTarget was there, but the migration tool replaced it with buildTarget. When I use browserTarget, I'm getting an error that it is deprecated.

    Here is my angular.json file:

    {
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
    "testAng": {
    "projectType": "application",
    "schematics": {
    "@schematics/angular:component": {
    "standalone": false
    },
    "@schematics/angular:directive": {
    "standalone": false
    },
    "@schematics/angular:pipe": {
    "standalone": false
    }
    },
    "root": "",
    "sourceRoot": "src",
    "prefix": "app",
    "architect": {
    "build": {
    "builder": "@angular-devkit/build-angular:application",
    "options": {
    "outputPath": "dist/test-ang",
    "index": "src/index.html",
    "browser": "src/main.ts",
    "polyfills": [
    "zone.js"
    ],
    "tsConfig": "tsconfig.app.json",
    "assets": [
    "src/favicon.ico",
    "src/assets"
    ],
    "styles": [
    "src/styles.css"
    ],
    "scripts": []
    },
    "configurations": {
    "production": {
    "budgets": [
    {
    "type": "initial",
    "maximumWarning": "500kb",
    "maximumError": "1mb"
    },
    {
    "type": "anyComponentStyle",
    "maximumWarning": "2kb",
    "maximumError": "4kb"
    }
    ],
    "outputHashing": "all"
    },
    "development": {
    "optimization": false,
    "extractLicenses": false,
    "sourceMap": true
    }
    },
    "defaultConfiguration": "production"
    },
    "serve": {
    "builder": "@angular-devkit/build-angular:dev-server",
    "configurations": {
    "production": {
    "buildTarget": "testAng:build:production"
    },
    "development": {
    "buildTarget": "testAng:build:development"
    }
    },
    "defaultConfiguration": "development"
    },
    "extract-i18n": {
    "builder": "@angular-devkit/build-angular:extract-i18n",
    "options": {
    "buildTarget": "testAng:build"
    }
    },
    "test": {
    "builder": "@angular-devkit/build-angular:karma",
    "options": {
    "polyfills": [
    "zone.js",
    "zone.js/testing"
    ],
    "tsConfig": "tsconfig.spec.json",
    "assets": [
    "src/favicon.ico",
    "src/assets"
    ],
    "styles": [
    "src/styles.css"
    ],
    "scripts": []
    }
    }
    }
    }
    }
    }


    How to solve the problem with "Property buildTarget is not allowed"?

    I am using

    • Angular: 17.1.1
    • Angular CLI: 17.1.1
    • Node: 20.11.0

    Continue reading...

Compartilhe esta Página