Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug electron applications with IntelliJ or WebStorm?

I'm using IntelliJ as development tool and I wanted to know how to debug an Electron application?

I'm aware there is a standard way to debug Electron applications, but this method is done outside of my IDE.

I've tried to create a new "Node.js" "Run/Debug Configuration" using:

  • Node interpreter: <path to node>
  • Working directory: <path to my application root folder>
  • JavaScript file: node_modules/.bin/electron
  • Application parameters: .

With this settings, my application starts, but if I put a breakpoint in my main.js the application never stops on the breakpoint (= debugging doesn't work).

like image 761
Anthony O. Avatar asked Sep 02 '15 08:09

Anthony O.


People also ask

How do you debug an Electron app?

You can start your Electron application in debug mode using the --debug flag, which will—by default—enable remote debugging on port 5858. Visual Studio Code is a free, open-source IDE available for Windows, Linux, and macOS and has been—coincidentally—built on top of Electron by Microsoft.

Does WebStorm have a debugger?

In WebStorm, the JavaScript debugger works out of the box and in most cases its default settings are sufficient. If necessary, you can configure the debugger as described in Configuring JavaScript debugger. WebStorm supports debugging client-side applications running on the built-in or an external web server.

How do I run a debug in WebStorm?

Start debugging If your application is running in the development mode on localhost , you can start debugging it from the built-in Terminal ( Alt+F12 ), from the Run tool window, or from the Debug tool window. Just hold Ctrl+Shift and click the URL at which the application is running.

Is WebStorm the same as IntelliJ?

Yes, IntelliJ Ultimate includes all WebStorm features. Most of them come as bundled plugins, but some features, e.g. Node. js support, are available as free plugins.


1 Answers

This is how I set it up, and it worked great. I then just put my break points inside of webstorm and it just works.

In webstorm create a new runtime configuration that looks like this.

Here is a screenshot of my webstorm run configuration

like image 76
frosty Avatar answered Sep 21 '22 14:09

frosty