nx-console icon indicating copy to clipboard operation
nx-console copied to clipboard

Project Graph Application Error

Open kylebjordahl opened this issue 1 year ago • 2 comments

Current Behavior

In IDE project graph fails to render in VS Code, returns error:

TypeError: Cannot read properties of undefined (reading 'projects')

Note: running the project graph in the browser via nx graph still works as expected

Expected Behavior

Project Graph should render within VS Code

Steps to Reproduce

Command Palette > Nx: Show full project graph

Failure Logs / Images / Videos

Screenshot 2024-03-18 at 10 35 35 AM

Environment

Nx Report

Node   : 20.11.1
OS     : linux-arm64
npm    : 10.2.4

nx                 : 18.0.7
@nx/js             : 18.0.7
@nx/jest           : 18.0.7
@nx/linter         : 18.0.7
@nx/eslint         : 18.0.7
@nx/workspace      : 18.0.7
@nx/cypress        : 18.0.7
@nx/devkit         : 18.0.7
@nx/eslint-plugin  : 18.0.7
@nx/plugin         : 18.0.7
@nx/react          : 18.0.7
@nx/remix          : 18.0.7
@nx/storybook      : 18.0.7
@nrwl/tao          : 18.0.7
@nx/vite           : 18.0.7
@nx/web            : 18.0.7
typescript         : 5.3.3
---------------------------------------
Community plugins:
@nxlv/python : 18.0.0
  • Nx Console version: v18.17.0
  • VSCode version: 1.87.2

kylebjordahl avatar Mar 18 '24 20:03 kylebjordahl

Hi thanks for reporting this! could you provide some logs and ideally a minimal repro? That will make it easier for us to fix the issue.

  • Go to Output -> Nx Console Client and paste what you see there.
  • Run Toggle Developer Tools and paste what you see there too
  • Finally, run nx daemon and provide the contents of the daemon.log file linked there

Thank you!

MaxKless avatar Mar 19 '24 09:03 MaxKless

Here you go @MaxKless !

Nx Console Client Log

[Nxls] - 2024-03-21T18:22:01.126Z - Using local Nx package at /home/vscode/workspace/node_modules/nx/src/utils/cache-directory.js

[Nxls] - 2024-03-21T18:22:01.138Z - Using local Nx package at /home/vscode/workspace/node_modules/nx/src/utils/cache-directory.js

[Nxls] - 2024-03-21T18:22:01.141Z - Generating graph with command: `npx nx graph  --file ./.nx/cache/nx-console-project-graph/project-graph.html`

[Nxls] - 2024-03-21T18:22:03.317Z - Using local Nx package at /home/vscode/workspace/node_modules/nx/src/utils/cache-directory.js

[Nxls] - 2024-03-21T18:22:03.319Z - Generating graph with command: `npx nx graph  --file ./.nx/cache/nx-console-project-graph/project-graph.html`

[Nxls] - 2024-03-21T18:22:05.079Z - Using local Nx package at /home/vscode/workspace/node_modules/nx/src/utils/cache-directory.js

Dev Tools Log

vscode-app-1711045399451.log

Screenshot 2024-03-21 at 11 24 00 AM

nx daemon log output (I captured this on a separate pass so the timestamps won't line up)

[NX Daemon Server] - 2024-03-21T21:30:31.780Z - Started listening on: /tmp/fdd2e125f081b6a16a65/d.sock
[NX Daemon Server] - 2024-03-21T21:30:31.860Z - [WATCHER]: Subscribed to changes within: /home/vscode/workspace (native)
[NX Daemon Server] - 2024-03-21T21:30:31.863Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-21T21:30:31.869Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-03-21T21:30:31.885Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-21T21:30:31.954Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-03-21T21:30:31.984Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-03-21T21:30:31.987Z - [REQUEST]: 
[NX Daemon Server] - 2024-03-21T21:30:31.988Z - [REQUEST]: 
[NX Daemon Server] - 2024-03-21T21:30:37.933Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-03-21T21:30:37.939Z - Time taken for 'total for creating and serializing project graph' 5979.263461ms
[NX Daemon Server] - 2024-03-21T21:30:37.970Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-03-21T21:30:37.972Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 5979. Response time: 39.
[NX Daemon Server] - 2024-03-21T21:30:38.016Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-03-21T21:35:23.457Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-21T21:35:23.569Z - Closed a connection. Number of open connections: 0
[NX Daemon Server] - 2024-03-21T21:43:49.243Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-03-21T21:43:49.245Z - Closed a connection. Number of open connections: 0

kylebjordahl avatar Mar 21 '24 18:03 kylebjordahl

Hey! This should be fixed in the latest version of nx console :) If you still see this error, please let me know and I'll reopen the issue and investigate again.

MaxKless avatar May 07 '24 11:05 MaxKless

Thanks @MaxKless, haven't seen this since!

kylebjordahl avatar Jun 01 '24 15:06 kylebjordahl