2
votes

I'm attempting to debug the main process of my electron app according to this https://blog.jetbrains.com/webstorm/2016/05/getting-started-with-electron-in-webstorm/

I've set up everything as described, but am getting an error when attempting to debug.

/Users/robertferentz/Work/connect-admin/node_modules/electron-prebuilt-compile/lib/cli.js --debug-brk=56546 --expose_debug_as=v8debug /Users/robertferentz/Work/connect-admin/src/index.js App threw an error during load Error: Cannot find module '/Users/robertferentz/Work/connect-admin/--debug-brk=56546' at Module._resolveFilename (module.js:455:15) at Function.Module._resolveFilename (/Users/robertferentz/Work/connect-admin/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at init (/Users/robertferentz/Work/connect-admin/node_modules/electron-compile/lib/config-parser.js:279:16) at main (/Users/robertferentz/Work/connect-admin/node_modules/electron-prebuilt-compile/lib/es6-init.js:38:29) at Object. (/Users/robertferentz/Work/connect-admin/node_modules/electron-prebuilt-compile/lib/es6-init.js:41:1) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32)

I've made sure all the settings are correct. Could be because I'm using electron-forge or does it not have anything to do with it?

2
weird - for some reason the option is appended to module path (/Users/robertferentz/Work/connect-admin/--debug-brk=56546), though the command looks OK. Can you try running just the same command (/Users/robertferentz/Work/connect-admin/node_modules/electron-prebuilt-compile/lib/cli.js --debug-brk=56546 --expose_debug_as=v8debug /Users/robertferentz/Work/connect-admin/src/index.js) in your system terminal? - lena
This happened to me when I started using electron-forge. Prior to that it worked fine. But after adding electron forge, the node interpreter in the run/debug configuration switches from node_modules/.bin/electron to node_modules/electron-prebuilt-compile/lib/cli.js, and there doesn't seem to be a way to change that while still using electron-forge. - soisystems

2 Answers

1
votes

Looks like an issue with electron-prebuilt-compile - see https://github.com/electron-userland/electron-prebuilt-compile/issues/23. Please try using electron-prebuilt instead

0
votes

In package.json:

electron-forge start -- %NODE_DEBUG_OPTION%

and running task in debug works fine.