dman
dman

Reputation: 11064

Angular CLI complains about missing configuration development but it is there

Angular 12 Node 14

I manually placed development under configurations, but when I run ng serve I still get

An unhandled exception occurred: Configuration 'development' is not set in the workspace. See "/tmp/ng-gDk9xQ/angular-errors.log" for further details.

Any ideas what is wrong?

       "configurations": {
          "development": {
            "optimization": false,
            "outputHashing": "all",
            "sourceMap": true,
            "namedChunks": true,
            "extractLicenses": false,
            "vendorChunk": true,
            "buildOptimizer": false,
            "budgets": []
          },
          "production": {
            "fileReplacements": [
              {
                "replace": "src/environments/environment.ts",
                "with": "src/environments/environment.prod.ts"
              }
            ],
            "baseHref": "/clinical/forms/",
            "optimization": true,
            "outputHashing": "all",
            "sourceMap": false,
            "extractCss": true,
            "namedChunks": false,
            "extractLicenses": true,
            "vendorChunk": false,
            "buildOptimizer": true,
            "budgets": [
              {
                "type": "initial",
                "maximumWarning": "2mb",
                "maximumError": "5mb"
              },
              {
                "type": "anyComponentStyle",
                "maximumWarning": "6kb",
                "maximumError": "10kb"
              }
            ]
          }
        }
      },
      "serve": {
        "builder": "@angular-devkit/build-angular:dev-server",
        "options": {
          "browserTarget": "custom-forms-ui:build"
        },
        "configurations": {
          "production": {
            "browserTarget": "custom-forms-ui:build:development"
          }
        },
        "defaultConfiguration": "development"
      },

Upvotes: 1

Views: 723

Answers (1)

kvetis
kvetis

Reputation: 7331

The problem is in your serve configuration - you do not provide development configuration there. You need to add/change:

"serve": {
    "builder": "@angular-devkit/build-angular:dev-server",
    "options": {
      "browserTarget": "custom-forms-ui:build"
    },
    "configurations": {
      "production": {
        "browserTarget": "custom-forms-ui:build:production"
      },
      "development": {
        "browserTarget": "custom-forms-ui:build:production"
      }
    },
    "defaultConfiguration": "development"
  },

Upvotes: 3

Related Questions