-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Update: Solution 🎉
If you are coming here from the warning given by wskdebug WARNING: wskdebug itself is debugged and likely NOT the action, then you have to update your VS Code launch config.
Starting with VS Code 1.48+ these settings are required to work with wskdebug:
"type": "pwa-node",
"request": "launch",
"attachSimplePort": 0,
"killBehavior": "polite",
Here is a complete example - adjust the args and name as needed:
"configurations": [
{
"name": "wskdebug MYACTION", // <-- adjust name for debug drop-down
"type": "pwa-node",
"request": "launch",
"attachSimplePort": 0,
"killBehavior": "polite",
"runtimeExecutable": "wskdebug",
"args": [
"MYACTION", // <-- replace with name of the action
"ACTION.js", // <-- replace with local path to action source file
"--cleanup", // remove helper actions on shutdown
"-l", // enable live-reload
"-v" // log parameters and results
],
"localRoot": "${workspaceFolder}",
"remoteRoot": "/code",
"outputCapture": "std"
}
]
This is also documented here: https://github.com/apache/openwhisk-wskdebug#nodejs-visual-studio-code
.
.
.
Original issue:
Problem
The new VS code debugger recently released (?) no longer sets --inspect-brk=XXXX for the debug port which wskdebug can intercept, but instead sets a NODE_OPTIONS with a custom --require that loads a (large) VS code javascript file into the process which apparently sets up debugging internally. This leads to the wskdebug node process itself being debugged, not the actual action on the container.
Links
- reported to vs code: Use SIGTERM instead of SIGKILL when ending processes, allow attachSimplePort=0 microsoft/vscode-js-debug#630 (maybe there is a solution!)
- new debugger https://github.com/microsoft/vscode-js-debug
- workaround from another bug with the new debugger
▶️ Solutions ◀️
Collecting all solutions here, will be kept updated.
Quick Workaround
Simple workaround for now: Disable the new debugger in VS Code by setting this in the user settings json:
"debug.javascript.usePreview": false
This will work as long as VS Code supports this feature.
Future fix
The new VS Code debugger will get some changes that make it work with wskdebug. To get a preview, one has to install the VS code debugger nightly. Do this at your own risk.
- install nightly of debugger plugin (after July 16)
- in launch config have this:
{ "type": "pwa-node", // important "request": "launch", "name": "wskdebug", "attachSimplePort": 0, // instead of "port", makes it auto-select a free debug port - use latest
wskdebug1.3.0 RC. install the pre-release from github directly:npm install -g https://github.com/apache/openwhisk-wskdebug