electron-react-boilerplate / electron-react-boilerplate/electron-react-boilerplate

Debug Main not working with Visual Studio Code on Windows

Closed
#3,689 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
24.3k
Forks
4k
Avg merge
20m
Merged PRs (30d)
4

Description

## Prerequisites

- [X] Using npm
- [X] Using an up-to-date [`main` branch](https://github.com/electron-react-boilerplate/electron-react-boilerplate/tree/main)
- [X] Using latest version of devtools. [Check the docs for how to update](https://electron-react-boilerplate.js.org/docs/dev-tools/)
- [X] Tried solutions mentioned in [#400](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/400)
- [X] For issue in production release, add devtools output of `DEBUG_PROD=true npm run build && npm start`

## Expected Behavior

Setting breakpoints on main process code and break the execution in those breakpoints.

## Current Behavior

The execution doesn't stop in the breakpoints. The breakpoints are disabled during execution (transparent circle, must be red).

## Steps to Reproduce

1. Click on Run and Debug
2. Select Electron: Main or Electron: All
3. Press the "run debug" button.
4. Set a breakpoint.
5. Run the code portion where the breakpoint is setted.

Maybe the launch.json is not properly configured, but i don't know how to fix it.

## Context

I'm writing a small utility desktop application in order to help the error checking of a new born product.
The boilerplate has no changes, i only write:
`app.commandLine.appendSwitch("remote-debugging-port", '9223')`
in main.js to fix the render debug (that is not working too without this fix).

## Your Environment

- Node version : 23.11.0
- electron-react-boilerplate version or branch : main branch, downloaded today 2024-04-04
- Operating System and version : Windows 11

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.