Javascript 渲染器进程的工作VSC启动配置?(“断点已设置但未绑定”问题)
VSC:1.42.1Javascript 渲染器进程的工作VSC启动配置?(“断点已设置但未绑定”问题),javascript,visual-studio-code,electron,Javascript,Visual Studio Code,Electron,VSC:1.42.1 电子:8.0.3 macOS:10.14.5 节点:11.15.0 这是我尝试过的许多启动配置之一。我可以成功调试main进程,但是renderer进程存在“断点已设置但未绑定”问题,因此从未触发断点 { "version": "0.2.0", "configurations": [ { "name": "Debug Main Process", "type": "node", "request": "launch",
电子:8.0.3
macOS:10.14.5
节点:11.15.0 这是我尝试过的许多启动配置之一。我可以成功调试
main
进程,但是renderer
进程存在“断点已设置但未绑定”问题,因此从未触发断点
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"program": "${workspaceRoot}/main.js",
"protocol": "inspector"
},
{
"name": "Debug Renderer Process",
"type": "chrome",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"runtimeArgs": [
"${workspaceRoot}/main.js",
"--remote-debugging-port=9222"
],
"webRoot": "${workspaceRoot}"
}
]
}
还尝试了Microsoft的示例,结果与上面相同:渲染器进程中的“断点已设置但未绑定”
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron: Main",
"protocol": "inspector",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": [
"--remote-debugging-port=9223",
"."
],
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
}
},
{
"name": "Electron: Renderer",
"type": "chrome",
"request": "attach",
"port": 9223,
"webRoot": "${workspaceFolder}",
"timeout": 30000
}
],
"compounds": [
{
"name": "Electron: All",
"configurations": [
"Electron: Main",
"Electron: Renderer"
]
}
]
}
在尝试调试
Electron
中的渲染器
进程时,我已经为“断点设置但未绑定”问题挣扎了数月。我将花几个小时四处搜索,尝试示例发布配置,尝试各种建议(例如),然后我放弃,直到下一次
它在VSC5或6版本之前确实可以工作,然后就坏了。我已经浏览了VSC github的“问题”页面,但没有任何效果。我am能够调试main
进程
我的项目结构如下所示。我没有使用webpack
、angular
、react
或任何其他类似的框架
有没有人有这样的启动配置?“console.log()”正在变得非常旧
我基本上就是在使用vscode菜谱中的第二个launch.json。我现在确实记得有过类似的问题,这两件事起了作用:
您应该发布launch.json。我至少可以把它比作mine@pushkin-谢谢你的答复。我刚刚发布了两种不同的发布配置,我已经尝试过了(我遇到的每一种都试过了)。如果你使用的是其他有效的东西,我很想看看。谢谢你的回复。您是说您正在使用devTools并在那里设置断点吗?我曾经能够在VSC本身中调试渲染器进程,而没有任何问题。我会试试你的方法。@NoGrabbing不,我还在VSCode中设置断点。我只是使用devtools刷新页面(Ctrl+R在关注我的应用程序时不会刷新,至少在我的情况下是这样。也许你已经对应用程序进行了不同的设置,以便正常工作)。您只需要能够使用选项1通过某种方式刷新页面。当我需要在渲染器中设置bps时,我通常更喜欢选项2,也许github会有一些问题来解释这一点。因为我记得它在某个点工作过,然后就停止了