when livereload-url is specified, the development server is not started.

Đang mở
#5,124 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu trong packages/@ionic/cli/src/commands/capacitor/base.ts và kiểm tra runServe cùng với hai dạng lệnh trong báo cáo. Tái hiện lệnh với --livereload-url và xác minh rằng máy chủ phát triển khởi động trong khi URL được cung cấp được sử dụng; xem lại pull request 5125 trước khi bắt đầu vì issue cho biết công việc đã được tiến hành.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

triage

Description:
with this command "ionic capacitor run android -l --external --host=192.168.7.78 --port=8021" the development server will be started. everything goes well. app will use http://192.168.7.78:8021/ to access the web app.
but with this command "ionic capacitor run android -l --external --host=192.168.7.78 --port=8021 --livereload-url=http://192.168.7.78:8021", the development serve does not start.

why do I want to specify host & port & the url? for whatever reason, my reality is that the android is connected to a "different" network, and there is some mapping, so even the livereload-url=https://x.y.z/(different IP, DNS or not, and even https), it will be mapped to http://192.168.7.78:8021.

Steps to Reproduce:
so simple, so need big effort.

Output:
so simple, no need

My ionic info:

Other Information:

To fix:
https://github.com/ionic-team/ionic-cli/blob/develop/packages/%40ionic/cli/src/commands/capacitor/base.ts
inside runServe function

  let serverUrl = options['livereload-url'] ? String(options['livereload-url']) : undefined;
  if (!serverUrl) {
    const details = await runner.run(runnerOpts);    //*********
    serverUrl = `${details.protocol || 'http'}://${details.externalAddress}:${details.port}`;
  }

we just have to move the ***** line out of the if statement, then everything is Okay. If I am wrong, please inform me.

If this is the right solution, then I made a pull request 5125: https://github.com/ionic-team/ionic-cli/pull/5125

Ngôn ngữ chính
TypeScript
Star
2k
Fork
681
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ionic-team/ionic-cli

Tất cả issue của ionic-team/ionic-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.