by Sai gowtham

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.

  1. First, open the deno project in vscode.
  2. Create a .vscode folder in the root directory.
  3. Now, create a launch.json file inside the .vscode folder and add the following configuration.
launch.json
{
    "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.

  1. Add the breakpoints in your script file and start debugging by pressing a shift+cmd+d keyboard shortcut or by clicking a play button in the left side panel.

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course