Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

628
Visualizações
Webstorm- Nodemon + Typescript + Docker - debugger connected but breakpoints not working

I have a node project written in typescript. The process runs inside a docker container using Nodemon. node (via nodemon) is run inside the container with the --inspect option. When I try to connect with Webstorm to the process, it connects but no breakpoints are being hit.

This command used in the package.json to start:
tsc-watch --incremental --onFirstSuccess "sh -c 'tscpaths -p tsconfig.json -s ./src -o ./dist/src && nodemon -L --inspect=0.0.0.0:9229 dist/src/main.js --config nodemon-debug.json'" --onSuccess "sh -c 'tscpaths -p tsconfig.json -s ./src -o ./dist/src && touch ./dist/src/main.js

Explanation: use tsc-watch to to watch for changes in code. After first build success run tscpaths to replace path shortcuts, then run nodemon with the inspect option (which is passed to node). After each build success run tscpaths and touch the main.js file to trigger nodemon to restart the process.

nodemon config (watch only main.js file which is touched after every build by tsc-watch):

{
  "watch": [
    "./dist/src/main.js"
  ],
  "ext": "js"
}

Port 9229 of the docker container is mapped to port 9666 on the host machine in the docker-compose.yml, and in Webstorm I use the "Attach to Node.js/Chrome" configuration to attach to localhost port 9666.

The tsconfig.json file includes "sourceMap": true.

This whole process of automatic build + restart on every code change works. The debugger is attached in Webstorm (The Debugger tab says "Connected to localhost:9666 - dist/src/main.js"). The problem is that no breakpoints are being hit. They are not marked with a "V" and are not being hit during execution.

Any ideas?

Using Webstorm 2021.1 on Windows 10.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

There is something you need to set up in the debugger.

Take a look at the config, and there's something called Remote URLs of local files(optional). You need to specifiy the RemoteURL for your file/directory so it can hit the debugger.

sample config

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda