Jay Sidri
Jay Sidri

Reputation: 6406

Debugging an Electron app : Breakpoints not working ("Breakpoint ignored because generated code not found")

I've got a basic HelloWorld app based on the electron-hello-world project running on VSCode and able to launch a debug session and the app starts up fine.

I've got a breakpoint set on main.js but it appears to be greyed out with a message:

Breakpoint ignored because generated code not found (source map problem?)

Here is my launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Main Process",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
      "program": "${workspaceRoot}/main.js",
      "port": 9222,
      "sourceMaps": true,
      "diagnosticLogging": true,
       "outFiles": [
         "${workspaceRoot}"
       ]
    }
  ]
}

Any help would be much appreciated.

Upvotes: 0

Views: 1583

Answers (1)

yashodhan divakaran
yashodhan divakaran

Reputation: 291

If your generated code is present in "${workspace Root}" then outFiles should be "outFiles": [ "${workspaceRoot}/*.js" ]. For more info link

Upvotes: 1

Related Questions