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

bug: App no longer transferred to device with "ionic cap run android -l --external" when using angular 17 and esbuild. #5061

Closed
3 tasks done
WillooWisp opened this issue Nov 14, 2023 · 10 comments · Fixed by #5064
Labels

Comments

@WillooWisp
Copy link

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

App is not transferred to device for live-reload after upgrading to angular 17 and esbuild.

Expected Behavior

I expect to see "capacitor.cmd run android --no-sync --target " in console, but it is never executed.

Steps to Reproduce

  1. Upgrade a sample app to angular 17+.
  2. Change to utilize esbuild through @angular-devkit/build-angular:application in angular.json.
  3. Run "ionic cap run android -l --external", which just starts the dev server, but never deploys the apk.

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 7.1.5 (C:\Users\joel\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 7.5.4
@angular-devkit/build-angular : 16.2.10
@angular-devkit/schematics : 16.2.10
@angular/cli : 16.2.10
@ionic/angular-toolkit : 10.0.0

Capacitor:

Capacitor CLI : 5.5.1
@capacitor/android : 5.5.1
@capacitor/core : 5.5.1
@capacitor/ios : 5.5.1

Utility:

cordova-res : not installed globally
native-run : 1.7.4

System:

NodeJS : v20.9.0 (C:\Program Files\nodejs\node.exe)
npm : 10.1.0
OS : Windows 10

Additional Information

Before angular 17 and esbuild...

[ng] √ Compiled successfully.

[INFO] Development server running!

       Local: http://localhost:8100
       External: http://172.24.64.1:8100, http://192.168.1.36:8100, http://192.168.32.66:8100, http://172.18.224.1:8100

       Use Ctrl+C to quit this process

> capacitor.cmd run android --no-sync --target R5CW143GQFX
[capacitor] √ Running Gradle build in 97.27s
[capacitor] √ Deploying app-debug.apk to R5CW143GQFX in 18.53s

[INFO] App deployed to device!

       Development server will continue running until manually stopped.

       Use Ctrl+C to quit this process

After angular 17 and esbuild...

[ng] Application bundle generation complete. [12.499 seconds]
[ng] Watch mode enabled. Watching for file changes...
[ng]   ➜  Local:   http://localhost:8100/
[ng]   ➜  Network: http://172.24.64.1:8100/
[ng]   ➜  Network: http://169.254.8.211:8100/
[ng]   ➜  Network: http://192.168.1.36:8100/
[ng]   ➜  Network: http://192.168.32.66:8100/
[ng]   ➜  Network: http://172.18.224.1:8100/

Call to "capacitor.cmd run android --no-sync --target R5CW143GQFX" is missing here!
@ionitron-bot ionitron-bot bot added the triage label Nov 14, 2023
@liamdebeasi liamdebeasi self-assigned this Nov 14, 2023
@liamdebeasi liamdebeasi transferred this issue from ionic-team/ionic-framework Nov 14, 2023
@liamdebeasi liamdebeasi removed their assignment Nov 14, 2023
@liamdebeasi
Copy link
Contributor

Hey there,

The ionic cap command is managed by the Ionic CLI, so I am going to move this to the CLI repo.

@WillooWisp
Copy link
Author

Okay, let's hope someone looks at this here then,

@liamdebeasi
Copy link
Contributor

Do you have a sample app I can reproduce the issue in?

@jcesarmobile
Copy link
Member

Looks like a bug in @angular-devkit/build-angular, when using the esbuild configuration it seems to hang the execution, so it "blocks" the execution of the following capacitor commands, while the old configuration doesn't hang and the capacitor commands can run.
Since the esbuild configuration is still in preview, you should probably report this behavior change to angular team.

@WillooWisp
Copy link
Author

Okay? So where is the proper place to report this issue then, do you know?

@jcesarmobile
Copy link
Member

Probably https://github.com/angular/angular-cli, it's the repository linked from npm for @angular-devkit/build-angular package.

@jcesarmobile
Copy link
Member

jcesarmobile commented Nov 17, 2023

I've been doing more digging and looks like I was wrong and the problem is in Ionic CLI.

Since @angular-devkit/build-angular:browser-esbuild uses vite, the Ionic CLI is not able to handle it correctly. We will need to create a new runner for Angular similar to the vue-vite and react-vite runners that were added recently.

I've just done a quick test and copied the vue-vite runner code into a new "angular-vite" type of app and it worked as expected.

@WillooWisp
Copy link
Author

Okay, yes, so it seems after the angular cli team investigated this.

angular/angular-cli#26396

@greg-md
Copy link

greg-md commented Dec 26, 2023

still not fixed?

@robsonos
Copy link

Same error here with Ionic 7.6.2 and Angular 17.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants