ionic-team / ionic-team/ionic-cli

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

未关闭
#4,947 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
2k
派生
682
PR 合并指标
30 天内没有已合并 PR

描述

**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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。