1

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"
      },

1 Answer 1

3

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"
  },
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.