ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Live updates are not sent to device when running ionic cap run with a Vue project

Open aldencolerain opened this issue 2 years ago • 0 comments

Description:

When running ionic cap run android on an actual device its necessary to specify the ip/host of the development server. This doesn't work as expected when using Vue.

Steps to Reproduce: I expect running with the --public-host argument to run the application on the device and have live updates sent to the phone via HRM: ionic cap run android --livereload --external --public-host=$EXTERNAL_IP

This doesn't work because the HMR public host is not also set on the Vue CLI Server. To fix this you must: ionic cap run android --livereload --external --public-host=$EXTERNAL_IP -- --public=http://$EXTERNAL_IP:8100

If attempt to set --host flag, it sets both the local and public host and fails with the following log:

[INFO] Waiting for connectivity with vue-cli-service...

My ionic info:


Ionic:

   Ionic CLI       : 6.20.4 (/usr/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 6.3.9

Capacitor:

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

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.1

System:

   NodeJS : v14.21.1 (/usr/bin/node)
   npm    : 6.14.17
   OS     : Linux 5.15

Other Information:

Also the -- argument forwarding should be documented: https://ionicframework.com/docs/cli/commands/capacitor-run

https://github.com/ionic-team/ionic-cli/blob/87a0dcdfd9f75b91e83c0eb13761d6135b226212/packages/%40ionic/cli/src/definitions.ts#L723

https://github.com/ionic-team/ionic-cli/blob/87a0dcdfd9f75b91e83c0eb13761d6135b226212/packages/%40ionic/cli/src/lib/project/vue/serve.ts#L104

aldencolerain avatar Jan 13 '23 04:01 aldencolerain