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

Nx console empty #1405

Closed
vire opened this issue Nov 7, 2022 · 42 comments
Closed

Nx console empty #1405

vire opened this issue Nov 7, 2022 · 42 comments
Labels
type: bug Something isn't working vscode Issues related to the Visual Studio Code extension

Comments

@vire
Copy link

vire commented Nov 7, 2022

might relate to #1197

image

(last working version v17.23.2)
image

Steps to Reproduce

Failure Logs / Images / Videos

Environment

nx-console: v17.24.2
`vscode veersion: 1.73.0 (Universal)

 >  NX   Report complete - copy this into the issue template

   Node : 16.16.0
   OS   : darwin arm64
   yarn : 3.2.2
   
   nx : 15.0.4
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.0.4
   @nrwl/detox : Not Found
   @nrwl/devkit : Not Found
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.0.4
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.0.4
   @nrwl/js : 15.0.4
   @nrwl/linter : 15.0.4
   @nrwl/nest : Not Found
   @nrwl/next : 15.0.4
   @nrwl/node : 15.0.4
   @nrwl/nx-cloud : 15.0.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.0.4
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.0.4
   @nrwl/web : 15.0.4
   @nrwl/webpack : Not Found
   @nrwl/workspace : 15.0.4
   typescript : 4.7.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
@vire vire added the type: bug Something isn't working label Nov 7, 2022
@Cammisuli
Copy link
Member

Is there any error message in the dev tools window? (help -> toggle developer tools)

Or in the output window?
image

@vire
Copy link
Author

vire commented Nov 7, 2022

Unfortunately, I can't see Nx Console in my vscode output
image

@MaxKless
Copy link
Collaborator

MaxKless commented Nov 7, 2022

Is there any error message in the dev tools window? (help -> toggle developer tools)

Can you try this?

@vire
Copy link
Author

vire commented Nov 7, 2022

I can see
image

@jpaas
Copy link

jpaas commented Nov 8, 2022

Ya I've had this same problem for a week or two now. That file exists in node_modules/nx/presets too.

@jpaas
Copy link

jpaas commented Nov 8, 2022

Just upgraded to nx 15.0.12. Same problem. My nx console = 17.25.0.

@vire
Copy link
Author

vire commented Nov 8, 2022

btw I'm on yarn --version 👉 3.2.2 so I don't have node_modules at all and I know NX does not support yarn2+ but it worked till v17.22.0

@jpaas
Copy link

jpaas commented Nov 8, 2022

yarn v1 classic for me

@MaxKless
Copy link
Collaborator

MaxKless commented Nov 9, 2022

I can't seem to reproduce this even in yarn repos. Do either of you have a repo where this happens that I can access?

@vire can you expand the error message so I have a bit more information?

@jpaas do you get the same 'Activating failed. Cannot find module' exception?

@jpaas
Copy link

jpaas commented Nov 9, 2022

Yes I get the same error. If I look in the Extension (host) logs I see

2022-11-09 09:01:55.770 [error] Activating extension nrwl.angular-console failed due to an error:
2022-11-09 09:01:55.770 [error] Error: Cannot find module 'nx/presets/npm.json'
    at Function.t [as resolve] (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:1:882)
    at t.Workspaces.readNxJson (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/172.js:22:518449)
    at a (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/172.js:22:509130)
    at Object.56797 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/172.js:22:527636)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.51031 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/172.js:27:24348)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.28919 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/172.js:27:14706)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.14560 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/172.js:22:28848)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.55860 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:1:36265)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.33834 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:1:35788)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.30526 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:1:35661)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at Object.65376 (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:1:2706)
    at s (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39483)
    at /Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39584
    at Function.s.O (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39834)
    at s.x (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:39604)
    at Function.s.x (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:40716)
    at /Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:40729
    at Object.<anonymous> (/Users/jpaas/.vscode/extensions/nrwl.angular-console-17.25.0/main.js:169:40832)
    at Module.u._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1313)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
    at Module.load (node:internal/modules/cjs/loader:1035:32)
    at Module._load (node:internal/modules/cjs/loader:876:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at Function.a._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:118:14563)
    at Function.v._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:113:64900)
    at Function.w._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:113:64268)
    at Module.require (node:internal/modules/cjs/loader:1059:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Function.r [as __$__nodeRequire] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:101)
    at h._loadCommonJSModule (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:113:66459)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)

@vire
Copy link
Author

vire commented Nov 9, 2022

I can't seem to reproduce this even in yarn repos. Do either of you have a repo where this happens that I can access?

@vire can you expand the error message so I have a bit more information?

@jpaas do you get the same 'Activating failed. Cannot find module' exception?

I have the same output as @jpaas

@jpaas
Copy link

jpaas commented Nov 9, 2022

Sorry @MaxKless this is on a private repo

@MaxKless
Copy link
Collaborator

have you tried running nx reset and reloading the window yet?

@jpaas
Copy link

jpaas commented Nov 16, 2022

So I discovered something today about this issue. Normally I launch VS Code by running vscode . from the root of my monorepo. This is because some extensions struggle with my rvm (ruby version manager) environment unless I do this. When I launch VS Code this way, the NX extension always fails to load the preset.

However if I just launch VS Code as an app from the OS, the NX extension works fine.

nx reset doesn't make a difference

@DiogoCastroSilva
Copy link

I have the same issue. Also if I try to refresh the console I get an error:

image

The console errors are the following:

image

Before the update, it was working fine. Now even if I revert the version I can't seem to make it work.
Thanks.

@DiogoCastroSilva
Copy link

I was able to fix it by reinstalling vs code. Now everything works.

@MaxKless
Copy link
Collaborator

I've been trying a lot but I can't reproduce this. Would be very grateful for a repo or any additional information you have on this.

@aloysb
Copy link

aloysb commented Dec 2, 2022

I have the same issue.

Can't share my repo though, it's private :)

Tried nx reset without any luck.

Starting vscode from the OS launcher fixes it, rather than opening it from the terminal if that helps ...

@stelescuraul
Copy link

I've been having the same issue for a while. Opening folders form terminal via code . fails with the error @vire reported above. However, the file core.json is present in node_modules/nx/presets.
If I open vscode from the launcher like @abitbetterthanyesterday mentioned, it works fine.

@sts125
Copy link

sts125 commented Dec 12, 2022

ditto on the extension launch failure from either code . or code foo.code-workspace

it launches just fine when clicking on a launch icon though. I'm running Ubuntu 18, so this isn't a mac-specific issue.

@Cammisuli
Copy link
Member

We still hear you all, and we're not ignoring this. But it's hard to track down this issue because we dont experience it ourselves.

I tried on multiple computers with different OSs and I still haven't stumbled across this issue.

I'm still going to keep my eyes opened and see if something comes up

@sts125
Copy link

sts125 commented Dec 13, 2022

Unfortunately my repo is private also.

When I display the Extensions Host log I get the same issue regarding 'nx/presets/npm.json' others have listed

The pop up error is the same "command 'nxConsole.refreshWorkspace' not found".

Running nx reset didn't help.

Several months ago on a machine with a different OS (mac), I was getting the "command 'nxConsole.refreshWorkspace' not found". I was able to work around by it downgrading the nx console extension by a dot version or two. That workaround didn't work in this case.

Yesterday I noticed I still had nx 14.x installed (don't remember exact version) so I migrated to the lastest version. This didn't help either, although I figured that was a longshot anyway.

Is there any other info besides (below) which would be useful?

Node : 14.17.1
OS : linux x64
yarn : 1.22.19

nx : 15.3.2
@nrwl/angular : Not Found
@nrwl/cypress : 15.3.2
@nrwl/detox : Not Found
@nrwl/devkit : 15.3.2
@nrwl/esbuild : Not Found
@nrwl/eslint-plugin-nx : 15.3.2
@nrwl/expo : Not Found
@nrwl/express : Not Found
@nrwl/jest : 15.3.2
@nrwl/js : 15.3.2
@nrwl/linter : 15.3.2
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 15.3.2
@nrwl/react-native : Not Found
@nrwl/rollup : 15.3.2
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : 15.3.2
@nrwl/webpack : 15.3.2
@nrwl/workspace : 15.3.2
typescript : 4.8.4

Local workspace plugins:

Community plugins:

vs code

Version: 1.74.0
Commit: 5235c6bb189b60b01b1f49062f4ffa42384f8c91
Date: 2022-12-05T16:47:18.476Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 4.15.0-200-generic
Sandboxed: No

scary how many vs code extensions I'm running which might be the source of a conflict

code --list-extensions
batisteo.vscode-django
bibhasdn.django-html
bierner.markdown-footnotes
ceyhunkeklik.vscode-ngrok-client
dbaeumer.vscode-eslint
deerawan.vscode-dash
dirk-thomas.vscode-lark
donjayamanne.githistory
eamodio.gitlens
EditorConfig.EditorConfig
esbenp.prettier-vscode
firsttris.vscode-jest-runner
folke.vscode-monorepo-workspace
formulahendry.terminal
gieson.dupe-file
GitHub.copilot
GitHub.vscode-pull-request-github
googlecloudtools.cloudcode
henoc.svgeditor
hiro-sun.vscode-emacs
HookyQR.beautify
HTMLHint.vscode-htmlhint
jock.svg
kamikillerto.vscode-linthtml
lostintangent.vsls-whiteboard
MakhmudovEvgeniy.currenttodos
miramac.vscode-exec-node
ms-azuretools.vscode-docker
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-toolsai.vscode-jupyter-cell-tags
ms-toolsai.vscode-jupyter-slideshow
ms-vscode-remote.remote-containers
ms-vscode.atom-keybindings
ms-vsliveshare.vsliveshare
ms-vsliveshare.vsliveshare-audio
ms-vsliveshare.vsliveshare-pack
nrwl.angular-console
okitavera.vscode-nunjucks-formatter
Prisma.prisma
ritwickdey.LiveServer
ronnidc.nunjucks
shamanu4.django-intellisense
silvenon.mdx
tootone.org-mode
VisualStudioExptTeam.intellicode-api-usage-examples
VisualStudioExptTeam.vscodeintellicode
xyc.vscode-mdx-preview
yzhang.markdown-all-in-one

@jpaas
Copy link

jpaas commented Dec 13, 2022

I'm trying to isolate what it might be. Our private repo where this happens is a package-based repo with 1 react native app and 2 react apps + a react native library. We are right up-to-date with Nx 15.3.3. Our default app is the react native app.

I just tried creating new nx repos using both the react native and react presets and I can't reproduce it.

@MaxKless
Copy link
Collaborator

@vire @stelescuraul @sts125 @abitbetterthanyesterday are your repos package-based too?
I can't reproduce this for the life of me and I'm just trying to find a common thread in addition to the code . behaviour.

Have you all tried reinstalling VSCode too? :D

@sts125
Copy link

sts125 commented Dec 15, 2022

@MaxKless I have an integrated repo with a few react apps, some react component libs, and a few plain old javascript libs.

Until now, I didn't think this had anything to do with my repo, but rather my machine being screwed up, but I'm seeing the same issue on my mac now. Reinstalling vscode didn't fix it.

Here's the exact error output, in case it differs from others:


2022-12-15 16:37:48.901 [error] Activating extension nrwl.angular-console failed due to an error:
2022-12-15 16:37:48.901 [error] Error: Cannot find module 'nx/presets/npm.json'
	at Function.t [as resolve] (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:1:882)
	at t.Workspaces.readNxJson (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/172.js:22:518449)
	at a (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/172.js:22:509130)
	at 56797 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/172.js:22:527636)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 51031 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/172.js:27:24348)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 28919 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/172.js:27:14706)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 14560 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/172.js:22:28848)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 55860 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:1:36527)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 33834 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:1:36050)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 30526 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:1:35923)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at 65376 (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:1:2556)
	at s (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39633)
	at /Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39734
	at s.O (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39984)
	at s.x (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:39754)
	at s.x (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:40866)
	at /Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:40879
	at Object.<anonymous> (/Users/sts125/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:177:40982)
	at u._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:1313)
	at Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
	at Module.load (node:internal/modules/cjs/loader:1035:32)
	at Module._load (node:internal/modules/cjs/loader:876:12)
	at c._load (node:electron/js2c/asar_bundle:5:13343)
	at r._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:120:13379)
	at w._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:61900)
	at v._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:61293)
	at Module.require (node:internal/modules/cjs/loader:1059:19)
	at require (node:internal/modules/cjs/helpers:102:18)
	at Function.r [as __$__nodeRequire] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:101)
	at d.pb (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:63164)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async Promise.all (index 0)

@aloysb
Copy link

aloysb commented Dec 18, 2022

@MaxKless yes and no, ours was package based until now but currently making the switch.

I know I had issues before about our code . was not loading environment variables properly.

I will try to reinstall VsCode, and see if my colleague has the same issue.

Will keep you updated.

@stelescuraul
Copy link

@MaxKless we use integrated repo in ours (also private, sorry).

  • I tried with a colleague and same repository works for him. We're both on linux.
  • I tried updating vscode, didn't solve it.
  • I tried updating my nvm setup, didn't solve it either.

Let me know what kind of info you need us to provide.

@danieldspx
Copy link

I am also having this problem, Nx Console version 17.27.1 does not work properly here. It says:

Error: Cannot find module 'nx/presets/core.json'
    at Function.t [as resolve] (/home/pc/.vscode/extensions/nrwl.angular-console-17.27.1/main.js:1:882)

But I checked and there is a nx/presets/core.json at the node_modules, also tried installed globally and it did not work.

The only way to make this work is to downgrade the v17.23.1 version. There is no special reason for choosing that version, I just wanted one that works so I choose one random and it work lol. Later I can see which version introduced the problem.

@MaxKless
Copy link
Collaborator

@danieldspx are you also starting VSCode through the CLI?

@danieldspx
Copy link

@danieldspx are you also starting VSCode through the CLI?

Yes, always 😅

@MaxKless MaxKless added the vscode Issues related to the Visual Studio Code extension label Mar 3, 2023
@MaxKless
Copy link
Collaborator

Hey I'm sorry that we still haven't found a solution here.
Can I just check in and ask whether y'all are still facing the same issue?

@ckot
Copy link

ckot commented Apr 20, 2023

I was seeing the exact same issue, for my private integrated repo, on both my Mac and Linux boxes. I'm currently at my mac, and it's working now!

NX and all extensions => 15.3.2
VS Code => 1.77.3
NX Console =>18.0.4

I'll report back regarding my linux box when I have a chance.

@MaxKless
Copy link
Collaborator

@vire @jpaas @danieldspx is this still happening for you?

@jpaas
Copy link

jpaas commented Jul 21, 2023

I just tried again. We're now up to nx 16.3.2. I opened the project with code . and it seems to work now. Nx extension is now populated. Thanks for following up @MaxKless

@danieldspx
Copy link

Same for me @MaxKless , everything working fine. Thanks for the support.

@MaxKless
Copy link
Collaborator

In that case I'll close this issue. Thanks everyone for your assistance.
Let me know if anything else breaks ;)

@shyagamzo
Copy link

Seems like this is still an issue...

image

The package is present in my node_modules folder:
image

Things I tried and didn't work:

  • Reinstalling Nx Console
  • Opening the project using File > Open Folder
  • Opening the project using code .
  • Reinstalling VSCode
  • nx reset
  • Cleaning up and reinstalling node modules

VSCode

Version: 1.84.0 (user setup)
Commit: d037ac076cee195194f93ce6fe2bdfe2969cc82d
Date: 2023-11-01T11:29:04.398Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621

Nx

Nx Console v18.10.0
[email protected]

@SkupeZZ
Copy link

SkupeZZ commented Nov 6, 2023

Having the same issue as @shyagamzo described
Activating extension 'nrwl.angular-console' failed: Cannot find module '@nx/nx-win32-x64-msvc'

@shyagamzo
Copy link

Updated Nx Console to the recently launched v18.10.1.
The extension now activates but the projects panel is missing:

image

@MaxKless
Copy link
Collaborator

MaxKless commented Nov 6, 2023

that's rly weird haha. I'm not seeing the same issue, can you right click and see if you can find the view?
Otherwise pls make a new issue
image

@shyagamzo
Copy link

Solved.

Seems like I played with the layouts in my attempts to fix this and the panel disappeared.

This did the final trick:
Ctrl + Shift + P > View: Reset View Locations

Thanks Max.

@MaxKless
Copy link
Collaborator

MaxKless commented Nov 6, 2023

Thanks everyone! I'm locking this issue to prevent spam for all participants. If you're still encountering issues, please make new issues!

@nrwl nrwl locked as resolved and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working vscode Issues related to the Visual Studio Code extension
Projects
None yet
Development

No branches or pull requests