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

Couldn't find any projects

Open BoilerTom90 opened this issue 1 year ago • 6 comments

I created a new nx workspace for an angular project.

image

I've opened vscode in the project root, and when I open the nx console, it says "we can't find any projects in this workspace."

image

Refreshing does nothing. I can run the "nx serve " command from the CLI and it works so I know I'm in the project workspace.

Current Behavior

Nx Console says it can't find any projects.

Expected Behavior

I was expecting the nx console to find my angular project. I've tried uninstalling and reinstalling, and also restarting vscode, but it can't find my project.

Steps to Reproduce

Failure Logs / Images / Videos

Environment

$ nx report

 NX   Report complete - copy this into the issue template

Node   : 18.18.2
OS     : win32-x64
npm    : 9.8.1

nx (global)        : 18.3.4
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/angular        : 18.3.4
@nx/cypress        : 18.3.4
@nx/devkit         : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nrwl/tao          : 18.3.4
@nx/web            : 18.3.4
@nx/webpack        : 18.3.4
typescript         : 5.4.5

Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin

  • Nx Console version: 18.12.0
  • VSCode version: 1.82.2

BoilerTom90 avatar Apr 27 '24 15:04 BoilerTom90

Having the same issue (in VS code and Webstorm). When pressing 'Refresh Workspace' in VS code gives me this output:

Telemetry: production Graph - init Error: Request nx/reset failed with message: Command failed: pnpm exec nx reset nx reset

Clears all the cached Nx artifacts and metadata about the workspace and shuts down the Nx Daemon.

Options: --help Show help [boolean] --version Show version number [boolean]

Error: EPERM: operation not permitted, unlink 'c:\git\bla.nx\cache\18.3.3-nx.win32-x64-msvc.node' at unlinkSync (node:fs:1878:11) at _unlinkSync (node:internal/fs/rimraf:214:14) at fixWinEPERMSync (node:internal/fs/rimraf:306:5) at rimrafSync (node:internal/fs/rimraf:200:14) at node:internal/fs/rimraf:253:9 at Array.forEach () at _rmdirSync (node:internal/fs/rimraf:250:7) at fixWinEPERMSync (node:internal/fs/rimraf:304:5) at rimrafSync (node:internal/fs/rimraf:200:14) at rmSync (node:fs:1268:10) { errno: -4048, code: 'EPERM', syscall: 'unlink', path: 'c:\git\bla\.nx\cache\18.3.3-nx.win32-x64-msvc.node' }

Hypenate avatar Apr 29 '24 07:04 Hypenate

Hey @BoilerTom90 could you share some logs from the Output -> Nx Language Server Tab as well? @Hypenate I'm working on an update that will fix the error message you're seeing. It really shouldn't be happening, though... Do you have another nx process running in the same repo, by any chance?

MaxKless avatar Apr 29 '24 07:04 MaxKless

@MaxKless No, I closed all nodejs instances via the Task Manager and the issue is still present.

Hypenate avatar Apr 29 '24 08:04 Hypenate

Hey @BoilerTom90 could you share some logs from the Output -> Nx Language Server Tab as well? @Hypenate I'm working on an update that will fix the error message you're seeing. It really shouldn't be happening, though... Do you have another nx process running in the same repo, by any chance?

I must be blind because I don't see a 'Output -> Nx Language Server' tab. Can you shed some light on where I would find that?

BoilerTom90 avatar Apr 29 '24 14:04 BoilerTom90

it's in the outputs tab in vscode. It could also be called Nx Console Client depending on your version. image

MaxKless avatar Apr 29 '24 14:04 MaxKless

ah, thanks for that. I haven't much of a need to look in that output console, until now. When I look at the choices in the OUTPUT pulldown menu, I see

  • Nx Console
  • Nx Console Client

I do not see Nx Language Server.

There isn't much in the Nx Console output, but here's the output from the Nx Console Client when I click the "refresh projects" button

[Nxls] - 2024-04-29T16:50:10.997Z - Retrieving workspace configuration

[Nxls] - 2024-04-29T16:50:10.998Z - Using local Nx package at d:/projects/nx-xcreg/xcreg3/node_modules/nx/src/project-graph/file-utils.js

[Nxls] - 2024-04-29T16:50:10.998Z - Using local Nx package at d:/projects/nx-xcreg/xcreg3/node_modules/nx/src/utils/output.js

[Nxls] - 2024-04-29T16:50:10.998Z - Using local Nx package at d:/projects/nx-xcreg/xcreg3/node_modules/nx/src/project-graph/file-map-utils.js

[Nxls] - 2024-04-29T16:50:10.999Z - Using local Nx package at d:/projects/nx-xcreg/xcreg3/node_modules/nx/src/project-graph/project-graph.js

[Nxls] - 2024-04-29T16:50:11.005Z - createProjectGraphAsync

[Nxls] - 2024-04-29T16:50:11.014Z - createProjectGraphAsync successful

process.exit called with code 1 [Nxls] - 2024-04-29T16:50:11.016Z - Unable to get nx workspace configuration: Error: Daemon process terminated and closed the connection

Messages from the log: [NX Daemon Server] - 2024-04-29T16:47:05.841Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 2. Response time: 1. [NX Daemon Server] - 2024-04-29T16:47:05.845Z - Closed a connection. Number of open connections: 1 [NX Daemon Server] - 2024-04-29T16:47:05.846Z - Established a connection. Number of open connections: 2 [NX Daemon Server] - 2024-04-29T16:47:05.846Z - Closed a connection. Number of open connections: 1 [NX Daemon Server] - 2024-04-29T16:47:05.846Z - Established a connection. Number of open connections: 2 [NX Daemon Server] - 2024-04-29T16:47:05.849Z - [REQUEST]: Responding to the client. handleRequestFileData [NX Daemon Server] - 2024-04-29T16:47:05.849Z - Done responding to the client handleRequestFileData [NX Daemon Server] - 2024-04-29T16:47:05.849Z - Handled REQUEST_FILE_DATA. Handling time: 0. Response time: 0. [NX Daemon Server] - 2024-04-29T16:50:11.006Z - Established a connection. Number of open connections: 3 [NX Daemon Server] - 2024-04-29T16:50:11.006Z - Closed a connection. Number of open connections: 2 [NX Daemon Server] - 2024-04-29T16:50:11.006Z - Established a connection. Number of open connections: 3 [NX Daemon Server] - 2024-04-29T16:50:11.008Z - [REQUEST]: Client Request for Project Graph Received [NX Daemon Server] - 2024-04-29T16:50:11.010Z - [REQUEST]: Responding to the client. project-graph [NX Daemon Server] - 2024-04-29T16:50:11.011Z - Time taken for 'total for creating and serializing project graph' 1.818900004029274ms [NX Daemon Server] - 2024-04-29T16:50:11.011Z - Done responding to the client project-graph [NX Daemon Server] - 2024-04-29T16:50:11.011Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 2. Response time: 1. [NX Daemon Server] - 2024-04-29T16:50:11.015Z - Closed a connection. Number of open connections: 2 [NX Daemon Server] - 2024-04-29T16:50:11.016Z - Established a connection. Number of open connections: 3 [NX Daemon Server] - 2024-04-29T16:50:11.016Z - Closed a connection. Number of open connections: 2

More information: d:\projects\nx-xcreg\xcreg3.nx\cache\d\daemon.log

--- it's worth nothing I have a couple other Nx projects that do not have this problem. The ones that do NOT have this problem are using an older version of Nx.

BoilerTom90 avatar Apr 29 '24 16:04 BoilerTom90

Hey @BoilerTom90! First of all, it looks like you're on an outdated version of Nx Console, so I'd recommend updating to ensure you have the latest bugfixes. If you're seeing these logs on nx 18.3.4, you're really quite behind.

Either way, I've added a PR https://github.com/nrwl/nx-console/pull/2120 which should hopefully catch this error and similar ones.

MaxKless avatar May 06 '24 09:05 MaxKless

I'm going to close this for now, if the issue still persists on a newer version of Nx Console please let me know. (I'm going to release a version with the fix from #2120 today as well)

Thank you!

MaxKless avatar May 06 '24 12:05 MaxKless

Hey @BoilerTom90! First of all, it looks like you're on an outdated version of Nx Console, so I'd recommend updating to ensure you have the latest bugfixes. If you're seeing these logs on nx 18.3.4, you're really quite behind.

Either way, I've added a PR #2120 which should hopefully catch this error and similar ones.

Max, I don't understand the comment. 18.3.4 is the latest version of Nx. How can I be behind? I didn't actually see any of these issues until I went to the latest of Nx and Nx Console.

BoilerTom90 avatar May 06 '24 13:05 BoilerTom90

Can you check your Nx Console version and paste it here? I'm asking because in your issue you list Nx Console 18.12.0 but the latest version is 18.21.1 https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console

So you're 10 versions behind. Maybe you have to update your VSCode as well to enable the latest Nx Console versions.

MaxKless avatar May 06 '24 13:05 MaxKless

We fixed it by adding @swc/helpers to the package.json

Hypenate avatar May 06 '24 13:05 Hypenate

Can you check your Nx Console version and paste it here? I'm asking because in your issue you list Nx Console 18.12.0 but the latest version is 18.21.1 https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console

So you're 10 versions behind. Maybe you have to update your VSCode as well to enable the latest Nx Console versions.

the problem is when you're installing extension from vscode market it is installing 18.12.0....

lpkobamn avatar Jul 28 '24 09:07 lpkobamn

Is it possible you haven't updated your VSCode in a while?

MaxKless avatar Jul 29 '24 12:07 MaxKless

My problem was very intermittent, and probably more to do with my PC needing frequent reboots. I haven't had this issue in many days.

BoilerTom90 avatar Jul 29 '24 12:07 BoilerTom90