-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Command error ^[[12;1R #22358
Comments
Hello, I have the same issue but using PNPM and with express and vite. Nx Report
When trying to serve vite project > nx run frontend:serve
"vite" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
Warning: command "vite serve" exited with non-zero status code
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Running target serve for project frontend failed
Failed tasks:
- frontend:serve
Hint: run the command with --verbose for more details. When trying to serve express project
This issue is not present on nx 18.0.8. This happens when nx is invoked from global or pnpm exec On PNPM has a workaround: execute nx using npx than global. |
@joelpelaez I tried switching back to 18.0.8 but had the same issue. On my macbook air m1 I'm not getting this error and was able to build properly in all apps/libs, for serve/build and develop/production. Only happening on my windows pc. Before that I was on version 16 of NX, and that was working just fine on my windows as well. |
@celsomtrindade Yes, nx has a lot of issues on Windows platform, many of them related to PNPM, but its because many Node tools are for UNIX platforms. |
@celsomtrindade I had the same issue issue like you, when execute the command It is possible be an issue related with the pseudo terminals (pty) than supports Windows 10. I detected other issues related with this, as multiple spawned conhost.exe process than using a lot of CPU. |
Same issue here. Even with 18.1.2. I got it to run by using |
Same issue on my side using the following :
|
Likewise, I found a workaround for me for now. I am having the same issue with other targets. In my case, it's I was able to get it to work by using the shorthand instead of the full command |
Hi to all, same problem here. It's randomic, sometimes works other not. like @celsomtrindade I receive
thanks ps: @FrozenPandaz perhaps it is correlated with #22313 ? |
Same issues as already mentioned preventing to upgrade to 18.1 ( coming from 17.x ) |
@x-etienne when I tried earlier versions of nx so 18.0 I did have a .env file but after doing a upgrade to version 18.1 it seems to be removed. and the setting to use edit: seems to work! |
This is very critical issue stopping us to update our workspace. Please give a workaround or solution as its been while this exists. |
Have you tried #22358 (comment) ? This should not be a definite solution, but it helps to work without stopping the proccess |
@rexkenley Those processes are conhost.exe instances for "headless" pesudoterminals, it's the same concept as pty in UNIX platforms, allows create virtual terminals that I/O is managed by nx using Rust native command runner, but that feature seems buggy on Windows. I detected these first time when using run-many in v18.0.*, when I kill the command using Ctrl-C always leaves some zombie processes that uses a complete CPU core per instance. The noisy CPU fan let me identify that issue. In that case, if you has NX Visual Studio Code plugin, nx server runs as VSCode child process then Task Manager shows them like that image. |
We are actively looking into this, but have been unable to reliably reproduce this. On my windows machine I was able to cause it to happen once, but it went away and I've not been able to get it to occur again. This isn't to say that its not reliably happening to some number of users, or that there's not a definite cause, just that it makes it harder to nail down. While we were troubleshooting it, @FrozenPandaz noted that an earlier PR (#21683) which was meant to fix similar issues had a minor mistake in it as we took some cargo changes for granted. A new PR (#22711 ) has been put up which will correct those inaccuracies and hopefully make this work smoother. After that PR has been merged and released, we will have to monitor for issues as we haven't been able to validate the fix ourselves. |
Would it matter what version of window's we're using? I am currently on a window 10 machine, which I could reproduce it every time without the .env file. |
I can easily reproduce on my win 11 laptop, but not with angular build or serve, or crystal based jest or lint... But I run into this with commands running the firebase cli using @nx:run-commands very often if not setting NX_NATIVE_COMMAND_RUNNER=false |
Still getting this error with 18.2.4 and the updated pty version for windows |
for those using "start":"cross-env NX_NATIVE_COMMAND_RUNNER=FALSE nx serve <app>" |
If it helps, the problem occurrs more often on a lower spec machine (we have a VM that gets it every time) or a machine under load |
So far the definitive workaround for the weird text is 1.) Delete .nx/cache Things start working again I once I do these 2 things. |
Upgraded from 17.2.3 to 18.2.4 and got the error why running nx test for the first time. Consecutive tests ran without problem also after clearing Nx cache
When using nx run to start Angular application
|
We encounter the same issue at random. Some of us get stuck with At least for us it seems to be happening more often in either of those two cases:
|
We are still looking into this and actively trying to repro, but in the meantime are going to disable the native command runner on windows by default. |
One way to reproduce is having a VHD machine with this specs (it happens most of the time):
Powershell Version table: The configuration belongs Likely to a vmware horizon virtual machine, which is the one I'm using. Unfortunately, I'm not authorized to disclose beyond that. |
NX_NATIVE_COMMAND_RUNNER=false works, but you need to write the value in lowercase. The nx code checks if !== 'false', so if anyone has tried to use the cross-env option and got it wrong probably it is because the value is set as FALSE |
It seems simply press 'Enter' after these weird characters show up will get the command going. So it's more of annoying than a blocker for us in development. Obviously it will be a totally different story if this happens in CI. Luckily our CI is running on Linux and this issue doesn't seem to affect it. |
Our ci also runs in Linux, however pressing enter did not resolve it for local development which was on windows. |
I can confirm that pressing Enter works for me too. This was also mentioned at the end of a duplicate issue #22650. Really strange that it sometimes waits for uses input like that. Maybe it's an useful hint for anyone investigating this. About reproducing: I'm using the next plugin and have a script |
Just to throw my hat in the ring, I found a workaround of running Problem is, you have to run that every time the error is encountered. Not a great solution in comparison to the other workarounds here, but I discovered that before finding this thread, and maybe, hopefully that will shed a little light on what's going on, or at least add to the evidence pile. |
There is a suggestion of NX_NATIVE_COMMAND_RUNNER=false. I understand that works around the issue, but what are the other impacts of setting that value to false? |
There's a chance #23039 fixed this, after it we haven't been able to repro on any of our machines which we were able to initially repro it on. That said, its been a flaky issue and before re-enabling the native command runner on windows for everyone, we'd like to ask some of yall to try out the fix. #23039 is available in both the latest v19 betas or the nightly canary release. Once on either of those branches, you can set the env variable If you do not see the issue reproduce after updating and setting
The native command runner runs tasks through a pseudo terminal, which enables Nx to track terminal outputs in a much more accurate way and also enables interactivity. This means even things like After updating, there's not really a reason to set the NX_NATIVE_COMMAND_RUNNER flag anymore though, since its disabled by default on windows now until we figure this out. |
@AgentEnder still having issues here with latest beta:
The telltale EDIT: (The process is hung here: https://github.com/nrwl/nx/blob/19.0.0-beta.11/packages/nx/src/tasks-runner/pseudo-terminal.ts#L88 and using process explorer I can see an idle cmd.exe launched with node arguments printed in the log underneath the main |
I believe I have a minimal reproducing example repo here: https://github.com/tsmithhisler/nx-repro-22358 |
Still aware of this issue - we are keeping an eye on it and spending time as we get it to try to narrow this down. |
Currently when updated some version minor of nx 18 not exist again this error for me in windows. |
@AgentEnder Could you answer this question? I'm curious also. |
|
I experience the same issue (it happens occasionally, about 1 in 10 runs) only locally on Windows, across different machines: Nx Version: I can press Enter in the console, and the issue goes away. The command then proceeds successfully. Interestingly, this never occurs in the CI/CD pipeline (GitLab Runner / Debian), where the build always runs without any failures. |
Current Behavior
When I run any NX command, such as
nx run admin:build:production
(or development) the console prints the line^[[12;1R
and doesn't proceed.Expected Behavior
Expect the command to execute the build process and finish.
GitHub Repo
No response
Steps to Reproduce
During the project creation I got this error message
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
This error
^[[12;1R
is not always the same, but always similar, such as^[[6;1R
,^[[4;1R
or^[[2;1R
The text was updated successfully, but these errors were encountered: