How to debug a Deno in VsCode
In this tutorial, we are going to learn about how to debug a deno code using the VsCode editor.
Debugging deno in VsCode
We can debug a deno in vscode by attaching a debugger manually using the launch.json file.
Note: The official support for a debugging via plugin is currently working on click here to know more.
-
First, open the deno project in vscode.
-
Create a
.vscodefolder in the root directory. -
Now, create a
launch.jsonfile inside the.vscodefolder and add the following configuration.
{
"version": "0.2.0",
"configurations": [
{
"name": "Deno",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": ["run", "--inspect-brk", "-A", "<entry-point>"], "outputCapture": "std",
"port": 9229
}
]
}In the above code, replace the <entry-point> with the script file path you want to debug for example
server.js or app.js.
- Add the breakpoints in your script file and start debugging by pressing a
shift+cmd+dkeyboard shortcut or by clicking aplaybutton in the left side panel.


