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

Multiple terminal popups on Windows #2149

Closed
cskiwi opened this issue May 26, 2024 · 27 comments · Fixed by nrwl/nx#26718
Closed

Multiple terminal popups on Windows #2149

cskiwi opened this issue May 26, 2024 · 27 comments · Fixed by nrwl/nx#26718
Labels
type: bug Something isn't working

Comments

@cskiwi
Copy link

cskiwi commented May 26, 2024

Current Behavior

Whenever I make a change in my project after updating to 19.1.0 a couple of terminals popup for a millisecond and then closing again.
Making the whole experience very disturbing because it takes the focus. Making it very hard to work

Expected Behavior

No popups or at least not ones that take the active focus

Steps to Reproduce

Have a project using nx 19.1.0 on windows

Failure Logs / Images / Videos

This is the same as: #1751

Environment

  • Nx Console version: 19.1.0
  • VSCode version: 1.89.1

nx report:

Node   : 20.12.2
OS     : win32-x64
bun    : 1.1.10

nx                 : 19.1.0
@nx/js             : 19.1.0
@nx/jest           : 19.1.0
@nx/linter         : 19.1.0
@nx/eslint         : 19.1.0
@nx/workspace      : 19.1.0
@nx/angular        : 19.0.2
@nx/devkit         : 19.1.0
@nx/eslint-plugin  : 19.1.0
@nx/nest           : 19.1.0
@nx/node           : 19.1.0
@nx/playwright     : 19.1.0
@nrwl/tao          : 19.1.0
@nx/web            : 19.1.0
@nx/webpack        : 19.1.0
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin
@nx/playwright/plugin
@nx/webpack/plugin
---------------------------------------
Community plugins:
@auth0/auth0-angular : 2.2.3
apollo-angular       : 7.0.1
ng-apexcharts        : 1.10.0
ng-process-env       : 16.0.6
ngxtension           : 3.3.0
---------------------------------------
The following packages should match the installed version of nx
  - @nx/[email protected]
  - @nrwl/[email protected]

I know that angular is still on a prev version of nx because one package hasn't updated to the new angular material formatting giving an error.
but I wouldn't think this would cause that issue

@cskiwi cskiwi added the type: bug Something isn't working label May 26, 2024
@MaxKless
Copy link
Collaborator

Hey @cskiwi thanks for the report!
We're aware of this issue and are working on a fix :) It has to do with a misconfiguration in how Nx runs things. The default set by Node.js when running any commands on windows is to show a popup like this. So sometimes we miss instances and forget to disable this "feature".
I'll let you know once we land something to fix it.

@Den-dp
Copy link

Den-dp commented Jun 3, 2024

@MaxKless if I understand the problem correctly, it can be solved once and for all by implementing workspace-wide ESLint rule for Nx Monorepo that fails if exec, spawn, fork etc are used without hideWindows parameter

@CodeWithBryan
Copy link

Everytime I come back to NX, this continues to be an issue. As someone that used to be a supporter of NX, it's very frustrating to be unable to use it outright. Given the severity of this issue, I would've expected an urgent fix, yet here we are months later still dealing with this on windows.

Yet another project I've had to pass NX usage on because of this exact cmd prompt popping issue.

@MaxKless
Copy link
Collaborator

Hey @CodeWithBryan I'm really sorry to hear about this. I tried reproducing on my windows machine and didn't see any popups on neither 19.1 nor latest. Could you paste your nx report and let me know what steps you're taking to see the popups? Like, what commands are you running, are you using them from just the nx cli or Nx Console?

@cskiwi are you still running into this too on the latest versions?

@nicolasebner
Copy link

I have the same issue, my colleague working on the same project as well.
This is really annoying.

I get cmd consoles popping up from: nx\src\daemon\server\start.js

Here my nx report:

Node : 20.14.0
OS : win32-x64
bun : 1.1.6

nx : 19.2.3
@nx/js : 19.2.3
@nx/jest : 19.2.3
@nx/linter : 19.2.3
@nx/eslint : 19.2.3
@nx/workspace : 19.2.3
@nx/cypress : 19.2.3
@nx/devkit : 19.2.3
@nx/eslint-plugin : 19.2.3
@nx/nest : 19.2.3
@nx/node : 19.2.3
@nx/react : 19.2.3
@nrwl/tao : 19.2.3
@nx/web : 19.2.3
@nx/webpack : 19.2.3
typescript : 5.4.5

Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin

@MaxKless
Copy link
Collaborator

Hey thanks everyone for the reports! @cskiwi @nicolasebner
Thanks to the nx report results I could track it down to the bun usage and have a fix in this PR nrwl/nx#26718

@Den-dp you're right it might be time to find a solution to prevent this behaviour altogether. I'll talk about it with the team.

@MaxKless
Copy link
Collaborator

Should be released later this week :)

meeroslav pushed a commit to nrwl/nx that referenced this issue Jun 27, 2024
…#26718)

## Current Behavior
Using bun as a package manager on windows causes cmd windows to pop up
when the project graph is computed.

## Expected Behavior
We shouldn't see any windows pop up.

## Related Issue(s)

Fixes nrwl/nx-console#2149
@Den-dp
Copy link

Den-dp commented Aug 18, 2024

@MaxKless if I understand the problem correctly, it can be solved once and for all by implementing workspace-wide ESLint rule for Nx Monorepo that fails if exec, spawn, fork etc are used without hideWindows parameter

@MaxKless speaking of the workspace-wide ESLint rule... Not sure whether it is still relevant to you, but while trying to fix a similar issue in nx-dotnet/nx-dotnet#887, I came up with the following rule nx-dotnet/nx-dotnet@253663f#diff-8f4b5073d52c957e7a4de5f5972eff8864a33308a60905f02cc5f80964e9fde8

@mklueh
Copy link

mklueh commented Sep 15, 2024

Still happening with 19.7.3...

no matter if I run serve, nx g app or just use IntelliJ with the Nx Plugin installed, I constantly see these windows popping up.

I had to disable the IntelliJ plugin because those windows stayed open and were frozen all the time

@MaxKless
Copy link
Collaborator

Yikes I'm sorry to hear that :/ I'll check it out today and see if I can repro it. Can you post your nx report results. Since it doesn't happen for me, I assume it's some code in a specific plugin on windows.

@MaxKless MaxKless reopened this Sep 16, 2024
@absurdism2
Copy link

guys, please prioritize this as much as it is possible for you. This really reduces productivity by a lot, on every file change in either of main IDEs you get n (3-10) popping out cmd windows (windows platform).

Node : 20.17.0
OS : win32-x64
Native Target : x86_64-windows
npm : 10.8.1

nx (global) : 19.1.2
nx : 19.6.4
@nx/js : 19.6.4
@nx/jest : 19.6.4
@nx/linter : 19.6.4
@nx/eslint : 19.6.4
@nx/workspace : 19.6.4
@nx/angular : 19.6.4
@nx/cypress : 19.6.4
@nx/devkit : 19.6.4
@nx/eslint-plugin : 19.6.4
@nx/react : 19.6.4
@nx/storybook : 19.6.4
@nrwl/tao : 19.6.4
@nx/vite : 19.6.4
@nx/web : 19.6.4
@nx/webpack : 19.6.4
typescript : 5.5.4

Registered Plugins:
@nx/eslint/plugin
@nx/storybook/plugin
@nx/vite/plugin

Community plugins:
@koliveira15/nx-sonarqube : 4.1.0
@storybook/angular : 8.2.9
angular-auth-oidc-client : 18.0.1

@MaxKless
Copy link
Collaborator

Will do! On it today :)

@absurdism2
Copy link

any update on the issue? this issue is literally unbearable.

@MaxKless
Copy link
Collaborator

MaxKless commented Sep 19, 2024

I've seen these before but I'm really struggling to reproduce the issue on my windows machine. Could you provide a reproduction repo that I can clone and see the issue myself @absurdism2 @mklueh? It must be some specific combination of plugins or the like that's causing this. Usually these popups don't come from Nx Console but from the underlying nx version itself.

I'd love to fix this ASAP but it's hard if I don't see the error myself.

@mklueh
Copy link

mklueh commented Sep 19, 2024

@MaxKless I can try that, but is it possible to get logs on what is opening the cmd with which arguments?

Maybe it's easier instead of building a reproducer project, and maybe it's something on my machine specifically.

@MaxKless
Copy link
Collaborator

You could try setting NX_VERBOSE_LOGGING=true and run some commands like nx show projects that calculate the project graph. Then you should also see the popups. Or is it only ever happening in Nx Console and never in the cli itself?

@absurdism2
Copy link

it does pop up whether you have nx-console installed or not (in my case Webstorm), "nx show projects" does trigger, popups, to check i uninstalled it. If i have nx console installed when it refreshes the workspace automatically it does trigger them too, it is not only when you save the file. Work like that is a torment.

@Den-dp
Copy link

Den-dp commented Sep 22, 2024

@MaxKless I found one of the problematic places while going through @absurdism2's report:

@nx/vite : 19.6.4
https://github.com/nrwl/nx/blob/19.6.4/packages/vite/src/utils/executor-utils.ts#L34

@absurdism2
Copy link

absurdism2 commented Sep 24, 2024

hi, unfortunately i can not share my repo. What i could add is that i see these terminals being run for e.g. git config, npm evec vite, both as admin and normal user, mainly these are "npm exec vite", run couple of times. I did not have this issue before updating nx to latest version.

@MaxKless
Copy link
Collaborator

So I couldn't figure out exactly where the issue was in the nx repo but I do have a PR to prevent all these messages: nrwl/nx#28073

Once it's released, let's make sure this is resolved!

@Den-dp
Copy link

Den-dp commented Sep 24, 2024

but I do have a PR to prevent all these messages: nrwl/nx#28073

81 files - that's an impressive amount of work 👏 thanks!

@absurdism2
Copy link

when r u guys planning on releasing it ?

@MaxKless
Copy link
Collaborator

very soon, you should see a beta or canary release within the day. Proper release this week I think

@MaxKless
Copy link
Collaborator

Hey! We just cut a release 19.8.1 that contains this. Can you update and confirm that the issue is gone?

@absurdism2
Copy link

Hi. Problems still there, however i see this is happening only on latest webstorm only now.

@absurdism2
Copy link

your fixes however did move issue forward, previously on every file change (save) I had ton of these terminals, now they only appear when workspace is being refreshed via nx console (webstorm plugin). after uninstalling it all seems fine now, which is inline with what people report here too: #1751

@MaxKless
Copy link
Collaborator

MaxKless commented Oct 1, 2024

That's nice! Are you on the latest nx console version for webstorm? I just released 1.32.1 which adds windowsHide in a couple of places in Nx Console as well. So those notifications should be gone.... Can you confirm that it still happens with that version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants