NativeScript / NativeScript/nativescript-cli
cli issues : env.uglify breaks console.log / hmr / debugger cannot connect device
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 1.1k
- 派生
- 204
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 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 :
- 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'
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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