You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在 2017年6月13日,18:01,仙森 ***@***.***> 写道:
@atian25 你看看那个 PR 有啥问题,没问题就合并掉了吧~
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Activity
atian25 commentedon Oct 11, 2016
好像有问题, 重启后端口占用, 之前的进程没退出.
估计是 egg cluster 守护了, vscode 干不掉, 再研究下
研究结果:
update:
npm run dev -- --debug然后 vscode 里面 attach.npm run dev -- --inspect用 chrome 来 debugatian25 commentedon Dec 21, 2016
1.8 里面可以这么用, 虽然调试体验还是一般.
{ "version": "0.2.0", "configurations": [ { "name": "start egg", "type": "node", "request": "launch", "program": "${workspaceRoot}/index.js", "cwd": "${workspaceRoot}", "runtimeArgs": [ "--debug" ], "port": 5859 }, { "name": "attach worker", "type": "node", "request": "attach", "port": 5858 }, { "name": "attach agent", "type": "node", "request": "attach", "port": 5856 } ], "compounds": [ { "name": "egg debug", "configurations": ["start egg", "attach worker", "attach agent"] } ] }atian25 commentedon Jan 3, 2017
嗯, 因为 attach 的太晚了, 这个可以再研究下.
我目前是放弃用 vscode 来 debug, 直接用 webstorm
atian25 commentedon Jan 4, 2017
如图, 无需什么特别配置
8000
p>
atian25 commentedon Feb 4, 2017
https://code.visualstudio.com/updates/v1_9#_debugging
1.9 版做了些优化,
Nodemon Setup和'restart' option,有兴趣的同学可以研究下,如何主动 attach 新的 worker debug portatian25 commentedon Feb 27, 2017
更新下,可以直接用 webstorm debug
npm scripts了,无需写入口文件。修改 npm scripts 为:
{ "dev": "egg-bin dev -- $NODE_DEBUG_OPTION", }然后在 webstorm 里面配置一个 npm 的 configuration 即可
用 webstorm debug 启动后,环境变量
$NODE_DEBUG_OPTION被赋值为类似--debug-brk=53243 --expose_debug_as=v8debug,从而被 egg-bin 传递进去。配置 VS Code debug atian25/blog#15
atian25 commentedon Mar 21, 2017
egg-bin 已经重构,支持传参,最新的 3.0,要去掉
--,即:并且 debug 指令改为继承 dev, 故建议用
egg-bin debughttps://github.com/eggjs/egg-bin#command
atian25 commentedon Mar 27, 2017
我擦,vscode 的 debug,支持
The Restart Frame action allows you to re-enter the current function after you have changed variables with the Set Value action新文档不错
https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_restart-frame-node
boizz commentedon Mar 27, 2017
webstorm启动一些大型例如
node_modules里面的文件夹层级太多的项目很容易崩atian25 commentedon Mar 27, 2017
@boizz 用我们写的 https://github.com/coolme200/webstorm-disable-index
boizz commentedon Mar 27, 2017
@atian25 666
atian25 commentedon Apr 21, 2017
现在通过 @okoala 写的 egg-development-proxyworker 可以完美实现 vscode debug egg 了。详见:https://eggjs.org/zh-cn/core/development.html#使用-vscode-进行调试
8 remaining items
atian25 commentedon Jun 13, 2017
okoala commentedon Jun 13, 2017
那个覆盖率问题,我稍后完善,不影响使用~
huboshu0819 commentedon Jun 13, 2017
@okoala 刚去官网提了issue,我看配置文件里面我有设置启动 attach worker额。

okoala commentedon Jun 13, 2017
@huboshu0819 直接在官网交流吧~
okoala commentedon Jun 13, 2017
eggjs/egg#1048
atian25 commentedon Sep 14, 2017
终于可以宣布该问题完美解决了~
ChaofengYan commentedon Sep 20, 2017
之前还好使的,现在一直报错
atian25 commentedon Sep 20, 2017
@ChaofengYan
npm update了没? 删除依赖重新安装下,不要 lock。ChaofengYan commentedon Sep 20, 2017
@atian25 使用egg-init 新建的一个type=simple项目,使用npm i安装依赖,没有lock,依然报同样的错误
atian25 commentedon Sep 20, 2017
我试了本地无法复现。
[-]使用 vscode@1.6 断点调试 egg cluster[/-][+]使用 vscode 断点调试 egg[/+][-]使用 vscode 断点调试 egg[/-][+]使用 vscode@1.6 断点调试 egg cluster[/+]atian25 commentedon Feb 8, 2018
终于,今天 VSCode@1.12.0 正式支持了 Automatically attach debugger to Node.js subprocesses
我们这个问题可以完美解决了,详细描述参见:#25
boizz commentedon Feb 9, 2018
天猪威武