0

I'm working on electron-react-boilerplate and I'm stuck on how to debug its main process (such as the src/main/main.ts file.

To reproduce my situation, simply follow the below steps, as documented in the above link:

git clone --depth 1 --branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate.git electron-react-boilerplate
cd electron-react-boilerplate
npm i 
npm start 

Now, I learnt how to debug the client side (browser side) js/ts script, as it is as simple as opening the dev tools and open the sourcemap-ed files, I can place a breakpoint.

But how is the main process, the electron process? I quickly googled it and found a github issue and the Debugging the Main Process guide page, it says:

Connect Chrome by visiting chrome://inspect and selecting to inspect the launched Electron app present there

So do I need to modify the package.json file in order to be able to debug the electron process files? (I tried to test with adding --inspect=5858 --remote-debugging-port=9223, opening a chrome with --remote-debugging-port=9223, opening "localhost:5858", or "chrome://inspect", but nothing happens. The devices tabs does not show the electron instance either.)

What am I missing with my setup? Thanks for your help.

5

1 Answer 1

0

If you are still facing the same issue it seems that they have released a fix for this, the commit that fixed the issue. I was able to debug both main and renderer after this.

Not the answer you're looking for? Browse other questions tagged or ask your own question.