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

Capacitor: Can't use interactive command if called by NX #925

Closed
bastienlemaitre opened this issue Apr 21, 2023 · 5 comments · Fixed by #970
Closed

Capacitor: Can't use interactive command if called by NX #925

bastienlemaitre opened this issue Apr 21, 2023 · 5 comments · Fixed by #970
Labels
bug Something isn't working

Comments

@bastienlemaitre
Copy link

bastienlemaitre commented Apr 21, 2023

Current Behavior

If I execute this command directly in the application folder, I can interact with the prompt by choosing my options with the command : npx --package=@capacitor/cli cap run ios --livereload --external

If this time I go through NX, via the command nx run app-insured:run:ios, I can't interact with the arrows and I see special characters : ^[[B^[[A^[[C^[[B^[[D^[[A^[[D

Here is the command:

"run": {
  "executor": "@nxext/capacitor:cap",
  "options": {
    "cmd": "run"
  },
  "configurations": {
    "ios": {
      "cmd": "run ios --livereload --external"
    },
    "android": {
      "cmd": "run android --livereload --external"
    }
  }
},

Expected Behavior

Have access to the interactive controls in the same way

GitHub Repo

No response

Steps to Reproduce

  1. Run nx run app-insured:run:ios which will propose options in the terminal to choose with the arrows.
  2. Choose your option with the arrow.
  3. Special characters will appear, not works
  4. Try to run the command associated with the last nx alias directly in the application folder
  5. Works, you can choose your option

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 19.4.0
   OS   : darwin arm64
   npm  : 9.2.0
   
   nx                      : 15.9.2
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/angular           : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/cypress           : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/storybook         : 16.0.0-beta.1
   @nrwl/tao               : 15.9.2
   @nrwl/webpack           : 15.9.2
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @nestjs/ng-universal        : 7.0.0
   @nguniversal/express-engine : 15.2.0
   @nguniversal/builders       : 15.2.0
   @nxext/capacitor            : 15.7.0
   @storybook/angular          : 7.0.5
   ---------------------------------------
   The following packages should match the installed version of nx
     - @nrwl/storybook@16.0.0-beta.1
   
   To fix this, run `nx migrate nx@16.0.0-beta.1`

Failure Logs

No response

Additional Information

No response

@bastienlemaitre bastienlemaitre added the bug Something isn't working label Apr 21, 2023
@bastienlemaitre bastienlemaitre changed the title Angular: Can't use interactive command if called by NX Capacitor: Can't use interactive command if called by NX Apr 23, 2023
@DominikPieper
Copy link
Member

I am still looking for a solution to that problem. Unfortunately, I'm not sure how to fix this cause it's just between the cap command and the Nx run executor. ^^'

@danespecno
Copy link

Might be worthwile creating a ticket on the NX github and linking it here?
Will provide visibility to both Nxext and NX

@arendjantetteroo
Copy link
Contributor

This seems related on the nx side: nrwl/nx#8269

@Schmale97
Copy link
Contributor

Is there a reason to use the runCommands code over execSync?

@DominikPieper
Copy link
Member

I just reused habe executor. Haven’t tried execSync here yet

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

Successfully merging a pull request may close this issue.

5 participants