> ## Content Index
> Fetch the complete content index at: https://lucas-schiavini.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Daily Dispatch 27 - Debugging Issues
- URL: https://lucas-schiavini.com/daily-dispatch-27-debugging-issues/
- Published: 2022-06-01T20:31:58.000Z
- Updated: 2022-08-16T14:43:45.000Z
- Author: Lucas Schiavini
- Tags: backend, docker, nodejs, dailydispatch, #Import 2026-08-11 14:49

So hello, it’s been a while, and I haven’t being keeping up with my daily dispatches, or maybe my days are longer than yours. Relativity man, who knows?

So I was playing around with a [Node.js (nodejs.org)](https://nodejs.org/en/?ref=lucas-schiavini.com) project hosting it using [Docker](https://www.docker.com/?ref=lucas-schiavini.com) alongside a [Postgres ](postgresql: The world's most advanced open source database)database.

And I was all happy and dandy until I wanted to debug an error on VSCode.

And I couldn’t.

So I went far and wide, talked with many friends (I wish), and came across this cool article [Debugging uncompiled Typescript code running on a Docker container | by Mitsuhide Ohi | Medium](https://mitsuhideohi.medium.com/debugging-uncompiled-typescript-code-running-on-a-docker-container-213418ab2b1f?ref=lucas-schiavini.com).

This article pointed me towards the right direction, but I had to add a few things.

1 – First of all, I didn’t need to add a `debug` script to my `package.json`. I merely replaced my `--inspect` flag with itself + server\_address:port `--inspect=0.0.0.0:9229`.  
2 – I did add the next line on my `tsconfig.json`.

"sourceMap": true

3 — Here’s where things differ a lot from the article, my vscode ***launch.json*** configuration didn’t use the **`sourceMapPathOverrides`** (it did nothing for me).

Instead I replaced it with these two cool properties ( **`remoteRoot`** and `**localRoot**`):

{
    "name": "Docker Node.js Launch",
    "type": "node",
    "request": "attach",
    "port": 9229,
    "address": "localhost",
    "skipFiles": [
        "<node_internals>/**"
    ],
    "remoteRoot": "/usr/app",
    "localRoot": "${workspaceFolder}",
}

4 – Now to the `***docker-compose.yml***` file, I added to my mainApp service the docker port for debugging

ports:
 - 3000:3000 # my previous port
 - 9229:9229 # docker debugger port

5 – After all that, I had to run `**docker-compose up -d --build --force-recreate**` since I changed the `***docker-compose.yml***` file.

And then BOOM! It worked.