Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#4,947 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
cli, documentation

调研方向

从 packages/@ionic/cli/src/lib/project/vue/serve.ts 和 definitions.ts 第 723 行附近的选项定义开始,然后复现文档中带有 --livereload、--external 和 --public-host 的 ionic cap run android 命令。完成的标准是 Vue 项目可以在设备上接收实时更新,而无需额外转发的 public-host 参数,并且已为 capacitor run 记录 -- 后参数的转发方式。

由索引模型根据 Issue 内容生成。

描述

triage

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

主要语言
TypeScript
星标
2k
派生
681
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/ionic-cli 的其他 Issue

查看 ionic-team/ionic-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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