NativeScript / NativeScript/nativescript-cli
cli issues : env.uglify breaks console.log / hmr / debugger cannot connect device
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 1.1k
- Fork
- 204
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 8
Mô tả
Environment
✔ Component nativescript has 7.0.11 version and is up to date.
✔ Component @nativescript/core has 7.0.12 version and is up to date.
✔ Component @nativescript/ios has 7.0.4 version and is up to date.
✔ Component @nativescript/android has 7.0.1 version and is up to date.
✔ Xcode version 12.1.0 satisfies minimum required version 10.
Describe the bug
I have several issues when deploying the app
Using the emulator :
- when I use the
--env.uglifyflag, console.log messages are not shown in the console. - when I have HMR active, the app closes after it launched. I have to manually start it to use it.
- navigating to
devtools://devtools/bundled/inspector.html?ws=localhost:41000gives a timeout :
Cannot connect to device socket. The error message is 'Timeout while waiting for lock "/Users//.local/share/.nativescript-cli/abb5c8da9f657a0090e2668a3a72a99b"'.
NativeScript debugger was not able to get inspector socket port on device 6F98B19F-AC48-4CE6-917C-590F22F2559B for application org.nativescript.foo.
Cannot connect to device socket. The error message is 'Device socket port cannot be found.'.
To Reproduce
- create a new ns Angular project with
ns create foo --ng - open
items.component.tsand add the lineconsole.log('NS rules!');tongOnInit - run the project with :
ns debug ios--> You see the added log message - run the project with :
ns debug ios --env.uglify- the app closes after it is started --> not correct
- start the app yourself manually, notice you don't see the added log message --> not correct
- run the project with :
ns debug ios --env.uglify --no-hmr--> the app does not close after it starts correct - navigate to
devtools://devtools/bundled/inspector.html?ws=localhost:41000
Sample project
See 'To Reproduce'
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện hành vi với ns debug ios, --env.uglify và --no-hmr, sử dụng console.log đã được thêm vào items.component.ts. Sau đó kiểm tra các điểm đầu vào CLI liên quan đến HMR, việc uglify và kết nối của trình gỡ lỗi với URL của inspector. Được xem là hoàn tất khi các lần chạy đã uglify vẫn giữ đầu ra console, HMR không đóng ứng dụng và trình gỡ lỗi kết nối được với thiết bị.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- ios, javascript
- Lĩnh vực
- cli, devtools, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100