# VSCode Node.js Typescript Debugging

### Debugging ts-node

First create your `launch.json` ( [visual studio code doc](https://code.visualstudio.com/docs/typescript/typescript-debugging) )

To allow breakpoints to work, we need to enable source maps in our `launch.json` as shown below:

{% code title=".vscode/launch.json" %}

```
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Example",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "node",
      "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],

      "args": ["${file}", "--sample-arg", "test"],

      "cwd": "${workspaceRoot}",
      "internalConsoleOptions": "openOnSessionStart",
      "skipFiles": ["<node_internals>/**", "node_modules/**"]
    }
  ]
}

```

{% endcode %}

Then get back to your file, and start the debugger.

![debugger statement should hit now](/files/-MW7Qjnu7rgtOwyF-7em)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.charged.fi/charged-particles-protocol/developing-on-the-protocol/quickstart/vscode-node.js-typescript-debugging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
