Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error running after upgrading to v14 #9976

Closed
Suyashtnt opened this issue Apr 23, 2022 · 6 comments · Fixed by #9994
Closed

error running after upgrading to v14 #9976

Suyashtnt opened this issue Apr 23, 2022 · 6 comments · Fixed by #9994
Assignees
Labels

Comments

@Suyashtnt
Copy link

Current Behavior

I am currently unable to run any commands as I am getting this error

glowsquid on  dev [!?⇡] via  v16.14.2 via 🦀 v1.59.0
❯ yarn nx run glow-ui:storybook
nx.js run [project][:target][:configuration] [_..]

Run a target for a project
(e.g., nx run myapp:serve:production).

You can also use the infix notation to run a target:
(e.g., nx serve myapp --configuration=production)

You can skip the use of Nx cache by using the --skip-nx-cache option.

Options:
      --version        Show version number                                                                                                                                        [boolean]
      --prod           Use the production configuration                                                                                                          [boolean] [default: false]
  -c, --configuration  Target configuration                                                                                                                                        [string]
      --project        Target project                                                                                                                                              [string]

{
  stack: "TypeError: Cannot read properties of null (reading 'projectConfig')\n" +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/utils/nx-plugin.js:30:84\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at loadNxPlugins (/mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/utils/nx-plugin.js:20:38)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-nodes/workspace-projects.js:17:119\n' +
    '    at Array.forEach (<anonymous>)\n' +
    '    at buildWorkspaceProjectNodes (/mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-nodes/workspace-projects.js:11:41)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-project-graph.js:75:54\n' +
    '    at Generator.next (<anonymous>)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/tslib/tslib.js:118:75\n' +
    '    at new Promise (<anonymous>)',
  message: "Cannot read properties of null (reading 'projectConfig')\n" +
    '\n' +
    'Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.\n' +
    'If the error persists, please run "nx reset".'
}

Expected Behavior

It to run properly

Steps to Reproduce

  1. clone https://github.com/glowsquid-launcher/glowsquid
  2. yarn install
  3. yarn dev
  4. see error

Failure Logs

glowsquid on  dev [!?⇡] via  v16.14.2 via 🦀 v1.59.0
❯ yarn nx run glow-ui:storybook
nx.js run [project][:target][:configuration] [_..]

Run a target for a project
(e.g., nx run myapp:serve:production).

You can also use the infix notation to run a target:
(e.g., nx serve myapp --configuration=production)

You can skip the use of Nx cache by using the --skip-nx-cache option.

Options:
      --version        Show version number                                                                                                                                        [boolean]
      --prod           Use the production configuration                                                                                                          [boolean] [default: false]
  -c, --configuration  Target configuration                                                                                                                                        [string]
      --project        Target project                                                                                                                                              [string]

{
  stack: "TypeError: Cannot read properties of null (reading 'projectConfig')\n" +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/utils/nx-plugin.js:30:84\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at loadNxPlugins (/mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/utils/nx-plugin.js:20:38)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-nodes/workspace-projects.js:17:119\n' +
    '    at Array.forEach (<anonymous>)\n' +
    '    at buildWorkspaceProjectNodes (/mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-nodes/workspace-projects.js:11:41)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-project-graph.js:75:54\n' +
    '    at Generator.next (<anonymous>)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/tslib/tslib.js:118:75\n' +
    '    at new Promise (<anonymous>)',
  message: "Cannot read properties of null (reading 'projectConfig')\n" +
    '\n' +
    'Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.\n' +
    'If the error persists, please run "nx reset".'
}

glowsquid on  dev [!?⇡] via  v16.14.2 via 🦀 v1.59.0
❯ yarn nx run tnt:serve
nx.js run [project][:target][:configuration] [_..]

Run a target for a project
(e.g., nx run myapp:serve:production).

You can also use the infix notation to run a target:
(e.g., nx serve myapp --configuration=production)

You can skip the use of Nx cache by using the --skip-nx-cache option.

Options:
      --version        Show version number                                                                                                                                        [boolean]
      --prod           Use the production configuration                                                                                                          [boolean] [default: false]
  -c, --configuration  Target configuration                                                                                                                                        [string]
      --project        Target project                                                                                                                                              [string]

{
  stack: "TypeError: Cannot read properties of null (reading 'projectConfig')\n" +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/utils/nx-plugin.js:30:84\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at loadNxPlugins (/mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/utils/nx-plugin.js:20:38)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-nodes/workspace-projects.js:17:119\n' +
    '    at Array.forEach (<anonymous>)\n' +
    '    at buildWorkspaceProjectNodes (/mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-nodes/workspace-projects.js:11:41)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/nx/src/project-graph/build-project-graph.js:75:54\n' +
    '    at Generator.next (<anonymous>)\n' +
    '    at /mnt/BulkStorage/projects/glowsquid/node_modules/tslib/tslib.js:118:75\n' +
    '    at new Promise (<anonymous>)',
  message: "Cannot read properties of null (reading 'projectConfig')\n" +
    '\n' +
    'Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.\n' +
    'If the error persists, please run "nx reset".'
}
``

### Environment

glowsquid on  dev [!?⇡] via  v16.14.2 via 🦀 v1.59.0
❯ nx report

NX Report complete - copy this into the issue template

Node : 16.14.2
OS : linux x64
yarn : 3.1.1

nx : 14.0.2
@nrwl/angular : Not Found
@nrwl/cypress : 14.0.2
@nrwl/detox : Not Found
@nrwl/devkit : 14.0.2
@nrwl/eslint-plugin-nx : 14.0.2
@nrwl/express : Not Found
@nrwl/jest : 14.0.2
@nrwl/js : 14.0.2
@nrwl/linter : 14.0.2
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : 13.3.1
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.0.2
@nrwl/web : Not Found
@nrwl/workspace : 14.0.2
typescript : 4.6.3
rxjs : 6.6.7

Community plugins:
@nxext/svelte: 13.3.1
@nxext/sveltekit: 13.0.0-next.02
@nxrs/cargo: 0.3.2

@AgentEnder
Copy link
Member

Hey @Suyashtnt, what does your nx.json look like?

@AgentEnder AgentEnder added the scope: core core nx functionality label Apr 25, 2022
@AgentEnder AgentEnder self-assigned this Apr 25, 2022
@Suyashtnt
Copy link
Author

Hey @Suyashtnt, what does your nx.json look like?

Im no longer using nx but here was the file when I was using it: https://github.com/glowsquid-launcher/glowsquid/blob/a0c4695cc4358a06db2e044e44fabd008d278b42/nx.json

@AgentEnder
Copy link
Member

Oh, ok. For what its worth, the error message you were getting was caused by listing a plugin (@nxtensions/astro) that was not installed in nx.json.

When we reverted some changes, a null check got missed and the log became a little obfuscated. I'll throw a PR up to correct that.

@trungtrong
Copy link

trungtrong commented May 7, 2022

Hi @AgentEnder , I still got this same issue today - 05/07/2022, Could you help me to check it? Thanks.

Issue:

$ nx serve host
nx.js run [project][:target][:configuration] [_..]

Run a target for a project
(e.g., nx run myapp:serve:production).

You can also use the infix notation to run a target:
(e.g., nx serve myapp --configuration=production)

You can skip the use of Nx cache by using the --skip-nx-cache option.

Options:
      --version        Show version number                                      [boolean]      --prod           Use the production configuration        [boolean] [default: false]  -c, --configuration  Target configuration                                      [string]      --project        Target project                                            [string]

{
  stack: "TypeError: Cannot read properties of undefined (reading 'endsWith')\n" +       
    '    at createProjectRootMappings (D:\\Documents\\Angular\\Angular-Rearching\\monorepos\\monorepo-example-four\\node_modules\\nx\\src\\project-graph\\file-map-utils.js:12:38)\n' +
    '    at createProjectFileMap (D:\\Documents\\Angular\\Angular-Rearching\\monorepos\\monorepo-example-four\\node_modules\\nx\\src\\project-graph\\file-map-utils.js:27:33)\n' +    '    at D:\\Documents\\Angular\\Angular-Rearching\\monorepos\\monorepo-example-four\\node_modules\\nx\\src\\daemon\\server\\project-graph-incremental-recomputation.js:92:85\n' +
    '    at Generator.next (<anonymous>)\n' +
    '    at fulfilled (D:\\Documents\\Angular\\Angular-Rearching\\monorepos\\monorepo-example-four\\node_modules\\tslib\\tslib.js:115:62)\n' +
    '    at processTicksAndRejections (node:internal/process/task_queues:96:5)',
  message: "Cannot read properties of undefined (reading 'endsWith')\n" +
    '\n' +
    'Because of the error the Nx daemon process has exited. The next Nx command is going 
to restart the daemon process.\n' +
    'If the error persists, please run "nx reset".'
}

nx.json

{
  "npmScope": "monorepo-example-four",
  "affected": {
    "defaultBase": "master"
  },
  "cli": {
    "defaultCollection": "@nrwl/angular"
  },
  "implicitDependencies": {
    "package.json": {
      "dependencies": "*",
      "devDependencies": "*"
    },
    ".eslintrc.json": "*"
  },
  "tasksRunnerOptions": {
    "default": {
      "runner": "nx/tasks-runners/default",
      "options": {
        "cacheableOperations": ["build", "lint", "test", "e2e"]
      }
    }
  },
  "targetDependencies": {
    "build": [
      {
        "target": "build",
        "projects": "dependencies"
      }
    ]
  },
  "generators": {
    "@nrwl/angular:application": {
      "style": "scss",
      "linter": "eslint",
      "unitTestRunner": "jest",
      "e2eTestRunner": "cypress"
    },
    "@nrwl/angular:library": {
      "linter": "eslint",
      "unitTestRunner": "jest"
    },
    "@nrwl/angular:component": {
      "style": "scss"
    }
  },
  "defaultProject": "host"
}

package.json

{
  "name": "monorepo-example-four",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "start": "nx serve",
    "start:host": "nx serve host",
    "build": "nx build",
    "test": "nx test",
    "postinstall": "ngcc --properties es2015 browser module main"
  },
  "private": true,
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.3.0",
    "@angular-eslint/eslint-plugin": "~13.1.0",
    "@angular-eslint/eslint-plugin-template": "~13.1.0",
    "@angular-eslint/template-parser": "~13.1.0",
    "@angular/cli": "~13.3.0",
    "@angular/compiler-cli": "~13.3.0",
    "@angular/language-service": "~13.3.0",
    "@nrwl/angular": "^14.1.4",
    "@nrwl/cli": "13.10.4",
    "@nrwl/cypress": "14.1.4",
    "@nrwl/eslint-plugin-nx": "14.1.4",
    "@nrwl/jest": "14.1.4",
    "@nrwl/linter": "14.1.4",
    "@nrwl/workspace": "13.10.4",
    "@types/jest": "27.4.1",
    "@types/node": "16.11.7",
    "@typescript-eslint/eslint-plugin": "~5.18.0",
    "@typescript-eslint/parser": "~5.18.0",
    "cypress": "^9.1.0",
    "eslint": "~8.12.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "^2.10.3",
    "jest": "27.5.1",
    "jest-preset-angular": "11.1.1",
    "nx": "13.10.4",
    "prettier": "^2.5.1",
    "ts-jest": "27.1.4",
    "ts-node": "9.1.1",
    "typescript": "~4.6.2"
  },
  "dependencies": {
    "@angular/animations": "~13.3.0",
    "@angular/common": "~13.3.0",
    "@angular/compiler": "~13.3.0",
    "@angular/core": "~13.3.0",
    "@angular/forms": "~13.3.0",
    "@angular/platform-browser": "~13.3.0",
    "@angular/platform-browser-dynamic": "~13.3.0",
    "@angular/router": "~13.3.0",
    "rxjs": "~7.4.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4"
  }
}

@AgentEnder
Copy link
Member

@trungtrong this is a different error, see the stack traces are different. My gut says you may have a project with no root set on it.

If that's not it, open a new issue so I can be tracked

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants