Debugging with VSCode¶
In VSCode, install Duktape Debugger extension.
Create a WhaleJS project as described in Getting started.
Open your project folder in VSCode.
Create “Duktape JS” debug configuration. Make sure you select debug port 26972.
{ "version": "0.2.0", "configurations": [ { "name": "Attach (duk)", "type": "duk", "request": "attach", "address": "localhost", "port": 26972, "localRoots": [ "${workspaceRoot}" ], "sourceMaps": false, "outDir": null, "stopOnEntry": true, "debugLog": false } ] }
Run your project with
whalejs-dbg.$ whalejs-dbg [path to project directory]
It will start the project in debug mode, and wait for debugger to attach.
In VSCode, run your Duktape JS debug session. Debugger will attach to already running
whalejs-dbgprocess.Now you should be able to put breakpoints and step through your code in VSCode debugger.