An unhandled exception occurred: Configuration 'dev' is not set in the workspace

Discussão em 'Angular' iniciado por Veselin Georgiev, Julho 31, 2025.

  1. I started to publish my Angular app. But I can't fix this error. I deployed in Azure. Add this looking easy. I think that the problem is in angular.json. Firstly I tried to update every dependency in package.json

    Where is the wrong in this config file?

    {
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
    "ODZ.Web": {
    "root": "",
    "sourceRoot": "src",
    "projectType": "application",
    "prefix": "app",
    "schematics": {},
    "architect": {
    "build": {
    "builder": "@angular-devkit/build-angular:browser",
    "options": {
    "progress": false,
    "extractCss": false,
    "outputPath": "dist",
    "index": "src/index.html",
    "main": "src/main.ts",
    "polyfills": "src/polyfills.ts",
    "tsConfig": "src/tsconfig.app.json",
    "assets": [
    "src/assets"
    ],
    "styles": [
    "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
    "node_modules/bootstrap/dist/css/bootstrap.min.css",
    "node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss",
    "node_modules/@fortawesome/fontawesome-free/scss/solid.scss",
    "node_modules/@fortawesome/fontawesome-free/scss/regular.scss",
    "node_modules/@fortawesome/fontawesome-free/scss/brands.scss",
    "node_modules/angular-bootstrap-md/assets/scss/bootstrap/bootstrap.scss",
    "node_modules/angular-bootstrap-md/assets/scss/mdb.scss",
    "node_modules/animate.css/animate.css",
    "src/styles.css"
    ],
    "scripts": [
    "node_modules/chart.js/dist/Chart.js",
    "node_modules/hammerjs/hammer.min.js"
    ]
    },
    "configurations": {
    "production": {
    "optimization": true,
    "outputHashing": "all",
    "sourceMap": false,
    "extractCss": true,
    "namedChunks": false,
    "aot": true,
    "extractLicenses": true,
    "vendorChunk": false,
    "buildOptimizer": true,
    "fileReplacements": [
    {
    "replace": "src/environments/environment.ts",
    "with": "src/environments/environment.prod.ts"
    }
    ]
    }
    }
    },
    "serve": {
    "builder": "@angular-devkit/build-angular:dev-server",
    "options": {
    "browserTarget": "ODZ.Web:build"
    },
    "configurations": {
    "production": {
    "browserTarget": "ODZ.Web:build:production"
    }
    }
    },
    "extract-i18n": {
    "builder": "@angular-devkit/build-angular:extract-i18n",
    "options": {
    "browserTarget": "ODZ.Web: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.css"
    ],
    "scripts": [],
    "assets": [
    "src/assets"
    ]
    }
    },
    "lint": {
    "builder": "@angular-devkit/build-angular:tslint",
    "options": {
    "tsConfig": [
    "src/tsconfig.app.json",
    "src/tsconfig.spec.json"
    ],
    "exclude": [
    "**/node_modules/**"
    ]
    }
    },
    "server": {
    "builder": "@angular-devkit/build-angular:server",
    "options": {
    "outputPath": "dist-server",
    "main": "src/main.ts",
    "tsConfig": "src/tsconfig.server.json"
    }
    }
    }
    },
    "ODZ.Web-e2e": {
    "root": "e2e/",
    "projectType": "application",
    "architect": {
    "e2e": {
    "builder": "@angular-devkit/build-angular:protractor",
    "options": {
    "protractorConfig": "e2e/protractor.conf.js",
    "devServerTarget": "ODZ.Web:serve"
    }
    },
    "lint": {
    "builder": "@angular-devkit/build-angular:tslint",
    "options": {
    "tsConfig": "e2e/tsconfig.e2e.json",
    "exclude": [
    "**/node_modules/**"
    ]
    },
    "configurations": {
    "production": {
    "devServerTarget": "ODZ.Web:serve:production"
    }
    }
    }
    }
    }
    },
    "defaultProject": "ODZ.Web"
    }


    I tried to fix this, but when I execute npm build --prod... I changed every dependency in my project, but didn't help. If someone is fixing this error. Bro, pleas help! Thanks!

    Continue reading...

Compartilhe esta Página