0

I have migrated nx workspace to the latest version. Now the angular version is 16. Below is project.json. When I run npm run build status is success but then when I proceed with npm run start I receive error. Maybe configuration is wrong for current executor/builder previously the builder was

 "builder": "ngx-build-plus:browser",

Required property 'outputPath' is missing.

{
  "name": "xyz",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "projectType": "application",
  "sourceRoot": "apps/xyz/src",
  "prefix": "xyz",
  "targets": {
    "build": {
      "executor": "@nx/angular:webpack-browser",
      "outputs": [
        "{options.outputPath}"
      ],
      "options": {
        "outputPath": "ui/dist/apps/xyz",
        "index": "apps/xyz/src/index.html",
        "main": "apps/xyz/src/main.ts",
        "polyfills": "apps/xyz/src/polyfills.ts",
        "tsConfig": "apps/xyz/tsconfig.app.json",
        "inlineStyleLanguage": "scss",
        "assets": [
          "apps/xyz/src/favicon.ico",
          "apps/xyz/src/assets"
        ],
        "styles": [
          "apps/xyz/src/styles.scss"
        ],
        "scripts": [],
        "commonChunk": false,
        "baseHref": "/xyz/",
        "customWebpackConfig": {
          "path": "apps/xyz/webpack.config.js"
        }
      },
      "configurations": {
        "production": {
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "4mb",
              "maximumError": "5mb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "4mb",
              "maximumError": "5mb"
            }
          ],
          "fileReplacements": [
            {
              "replace": "apps/xyz/src/environments/environment.ts",
              "with": "apps/xyz/src/environments/environment.prod.ts"
            }
          ],
          "outputHashing": "all",
          "customWebpackConfig": {
            "path": "apps/xyz/webpack.prod.config.js"
          }
        },
        "development": {
          "buildOptimizer": false,
          "optimization": false,
          "vendorChunk": true,
          "extractLicenses": false,
          "sourceMap": true,
          "namedChunks": true
        }
      },
      "defaultConfiguration": "production"
    },
    "serve": {
      // "executor": "ngx-build-plus:dev-server",
      "executor": "@nx/angular:webpack-browser",
      // "executor": "@nx/angular:webpack-dev-server",
      // "executor": "@nx/angular:module-federation-dev-server",
      "configurations": {
        "production": {
          "browserTarget": "xyz:build:production",
          "customWebpackConfig": {
            "path": "apps/xyz/webpack.prod.config.js"
          }
        },
        "development": {
          "browserTarget": "xyz:build:development"
        }
      },
      "options": {
        "customWebpackConfig": {
          "path": "apps/xyz/webpack.config.js"
        },
        "port": 4400,
        "publicHost": "http://localhost:4400"
      },
      "defaultConfiguration": "development"
    },
    "extract-i18n": {
      "executor": "ngx-build-plus:extract-i18n",
      "options": {
        "browserTarget": "xyz:build"
      }
    },
    "lint": {
      "executor": "@nx/linter:eslint",
      "options": {
        "lintFilePatterns": [
          "apps/xyz/src/**/*.ts",
          "apps/xyz/src/**/*.html"
        ]
      },
      "outputs": [
        "{options.outputFile}"
      ]
    },
    "test": {
      "executor": "@nx/jest:jest",
      "options": {
        "jestConfig": "apps/xyz/jest.config.ts",
        "passWithNoTests": true,
        "customWebpackConfig": {
          "path": "apps/xyz/webpack.config.js"
        }
      }
    }
  },
  "tags": []
}
Walter White
  • 976
  • 4
  • 12
  • 29

0 Answers0