NativeScript / NativeScript/nativescript-cli

cli issues : env.uglify breaks console.log / hmr / debugger cannot connect device

オープン
#5,429 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

説明

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 :

  1. when I use the --env.uglify flag, console.log messages are not shown in the console.
  2. when I have HMR active, the app closes after it launched. I have to manually start it to use it.
  3. navigating to devtools://devtools/bundled/inspector.html?ws=localhost:41000 gives 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.ts and add the line console.log('NS rules!'); to ngOnInit
  • run the project with : ns debug ios --> You see the added log message
  • run the project with : ns debug ios --env.uglify
    1. the app closes after it is started --> not correct
    2. 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'

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、items.component.ts に追加された console.log を使い、ns debug ios--env.uglify--no-hmr で動作を再現します。次に、HMR、uglification、デバッガーから inspector URL への接続に関係する CLI のエントリーポイントを調べます。uglify された実行でコンソール出力が保持され、HMR がアプリを閉じず、デバッガーがデバイスに接続できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ios, javascript
領域
cli, devtools, mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。