Skip to content

Debugging problems

vadimcn edited this page Sep 16, 2021 · 9 revisions

Debugging Swift

Symptom: When debugging Swift binaries, local variables are garbled or not shown at all.

See Swift page.

Debugging Electron app plugins

Symptom: Electron applications fail to launch under the debugger with an error similar to this:

const rc = app.rc = require('../rc')      
TypeError: Cannot set property 'rc' of undefined

Electron applications typically consist of several cooperating processes, some of which have specific roles, as configured by environment variables set the main process. Since VSCode is an Electron application itself, its children, including the debugger and the debuggee will inherit these variables as well, which may cause them to function incorrectly. The solution is to reset all ELECTRON_... variables in the launch configuration:

"env": { 
    "ELECTRON_RUN_AS_NODE": "",
    "ELECTRON_NO_ATTACH_CONSOLE": "",
}