A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'C:\electron2\electron_app\--inspect-brk=15965'
at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.Module._resolveFilename (C:\electron2\electron_app\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (internal/modules/cjs/loader.js:528:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at init (C:\electron2\electron_app\node_modules\electron-compile\lib\config-parser.js:294:16)
at main (C:\electron2\electron_app\node_modules\electron-prebuilt-compile\lib\es6-init.js:58:29)
at Object.<anonymous> (C:\electron2\electron_app\node_modules\electron-prebuilt-compile\lib\es6-init.js:61:1)
at Object.<anonymous> (C:\electron2\electron_app\node_modules\electron-prebuilt-compile\lib\es6-init.js:63:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
我的调试配置看起来像这样。
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args" : ["."]
}
]
}
另外还捕获了一个错误:
No such module: atom_browser_features
我以前从未听说过这个模块。
以前可以使用,但突然间就不能用了。有人知道问题可能是什么吗?
--inspect-brk=15965
被解释为“主”脚本。查看VSCode在调试器下运行电子时生成的命令将非常有用。 - Jake Holzingerelectron-quick-start
项目,当我运行“调试主进程”配置时,我会得到以下命令:G:\Development\vscode-electron-debug\electron-quick-start/node_modules/.bin/electron.cmd --inspect-brk=32785 main.js
。我也没有问题在electron@3.0.8
下运行快速启动应用程序,所以问题可能出在别处。 - Jake HolzingerC:/test/node_modules/.bin/electron.cmd --remote-debugging-port=9223 . --inspect-brk=47365
。升级到v3.0.8似乎已经解决了这个问题,谢谢! 如果在Debug View(F1,“Focus on Breakpoints View”)中勾选“All Exceptions”,然后开始调试,您仍然应该看到这些错误,但它们不再影响我的其余调试会话。我认为可以安全地忽略它们,因为它们是被稍后捕获的一次性异常。随时发布回答以获取赏金 :) - noseratio - open to work