electron / electron/forge

VSCode debug not launching application

Open
#2,789 2 comments 0 reactions 0 assignees View on GitHub
bug documentation
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron-userland/electron-forge/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

6.0.0-beta.63

### Electron version

v17.2.0

### Operating system

Windows 10 (19042)

### Last known working Electron Forge version

_No response_

### Expected behavior

Being able to debug electron-forge application in VSCode

### Actual behavior

With the vscode launch config provided in the documentation

``` json
{
"type": "node",
"request": "launch",
"name": "Electron Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron-forge-vscode-nix",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron-forge-vscode-win.cmd"
},
// runtimeArgs will be passed directly to your Electron application
"outputCapture": "std",
"env": {
"DEBUG": "electron-forge:*"
},
"runtimeArgs": [
"foo",
"bar"
],
"cwd": "${workspaceFolder}"
},
```

I am not able to get the application launched.

### Steps to reproduce

When I start debugging my project through vscode, the step `Launch Application` is not triggered (no appropriate comment in the DEBUG CONSOLE of vscode).
It says that the debugger is attached but the application does not start and thus, no breakpoint that I have set are hit.

![image](https://user-images.githubusercontent.com/43267376/161069084-75f43f7a-d833-4fb5-b314-ff8bb0f120d3.png)

When I start the project normally through `npm run start` everything works fine and the application starts.

![image](https://user-images.githubusercontent.com/43267376/161071466-8775c39c-91c1-4867-afda-ec6e93213305.png)

What could be the reason for this?

Thanks in advance for your help and Best Regards

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.