首页 > 解决方案 > Electron 中的“断点设置但未绑定”问题

问题描述

VSC:1.42.1
电子:8.0.3
macOS:10.14.5
节点:11.15.0

尝试在 中调试renderer进程时Electron,由于“已设置断点但未绑定”问题,不会触发任何断点。

渲染器中的断点在 VSC 5 或 6 版本之前工作,然后在更新中中断。我一直在如此,VSC github“问题”页面,没有一个例子有帮助。VSC调试不能为每个人打破。

我的项目结构如下所示,我正在使用的启动配置也是如此。


{
      "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"
              ]
          }
      ]
  }

在此处输入图像描述

标签: javascriptvisual-studio-codeelectron

解决方案


推荐阅读