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 摘要。