Giter Club home page Giter Club logo

Comments (1)

alextrep96 avatar alextrep96 commented on June 1, 2024

We are facing the same issue since version 18.0.0, now on 18.0.7 and still an issue. The use of Nx is completely broken, since the repo cannot be resolved at all. Even simple tasks such as running nx report don't work.

It seems that most if not all our apps cause an issue with an error like

 NX   Unable to merge project information for "apps/api-alerts-scheduler" from apps/api-alerts-scheduler/project.json using plugin nx/core/project-json. 

         Inner Error: TypeError: Cannot read properties of undefined (reading 'join')
    at isCompatibleTarget (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:355:67)
    at mergeTargetConfigurations (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:294:26)
    at mergeProjectConfigurationIntoRootMap (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:111:34)
    at /Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:204:21
    at async createProjectConfigurations (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:62)
    at async buildProjectGraphAndSourceMapsWithoutDaemon (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/project-graph.js:71:69)
    at async createProjectGraphAndSourceMapsAsync (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/project-graph.js:136:25)
    at async createProjectGraphAsync (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/project-graph/project-graph.js:125:39)
    at async Object.affected (/Users/alexistrepanier/dev/assek/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/command-line/affected/affected.js:33:26)

Here is the project configuration for the project referenced in the error:

{
  "name": "api-alerts-scheduler",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/api-alerts-scheduler/src",
  "projectType": "application",
  "targets": {
    "build": {
      "executor": "@nx/webpack:webpack",
      "outputs": ["{options.outputPath}"],
      "defaultConfiguration": "production",
      "options": {
        "outputPath": "dist/apps/api-alerts-scheduler",
        "main": "apps/api-alerts-scheduler/src/main.ts",
        "tsConfig": "apps/api-alerts-scheduler/tsconfig.app.json",
        "assets": ["apps/api-alerts-scheduler/src/assets"],
        "generatePackageJson": true,
        "target": "node",
        "compiler": "tsc",
        "webpackConfig": "apps/api-alerts-scheduler/webpack.config.js"
      },
      "configurations": {
        "production": {
          "optimization": true,
          "extractLicenses": true,
          "inspect": false
        },
        "development": {
          "optimization": true,
          "extractLicenses": true,
          "inspect": false
        }
      }
    },
    "serve": {
      "executor": "@nx/js:node",
      "defaultConfiguration": "development",
      "options": {
        "buildTarget": "api-alerts-scheduler:build"
      },
      "configurations": {
        "production": {
          "buildTarget": "api-alerts-scheduler:build:production"
        },
        "development": {
          "buildTarget": "api-alerts-scheduler:build:development"
        }
      }
    },
    "lint": {
      "executor": "@nx/eslint:lint",
      "outputs": ["{options.outputFile}"]
    },
    "test": {
      "executor": "@nx/jest:jest",
      "outputs": ["{workspaceRoot}/coverage/apps/api-alerts-scheduler"],
      "options": {
        "jestConfig": "apps/api-alerts-scheduler/jest.config.ts"
      }
    },
    "deploy": {
      "executor": "nx:run-commands",
      "options": {},
      "configurations": {
        "production": {
          "command": "bash ./infra/terraform/web-api/deploy-web-api.sh prod alerts-scheduler"
        },
        "development": {
          "command": "bash ./infra/terraform/web-api/deploy-web-api.sh dev alerts-scheduler"
        }
      },
      "inputs": [
        "deploy-default",
        "^production",
        "{workspaceRoot}/infra/terraform/web-api/**/*",
        "{workspaceRoot}/infra/terraform/common/**/*"
      ],
      "defaultConfiguration": "development"
    }
  },
  "tags": []
}

It does look like the issue is coming from the nx:run-commands executor. If I remove our custom target, the error seems to go away, but then the next app with the nx:run-commands fails.

from nx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.