Summary
I'm running a node app inside a docker container can't get the VS code debugger to hit breakpoints.
Docker Setup
The docker container exposes port 5859. Inside the container the node app is ran with this command:
nodemon -L --watch src --exec babel-node src/server.js -- --inspect=0.0.0.0:5859 --nolazy
It reports that the debugger is listening:
[nodemon] 1.19.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /app/src/**/*
[nodemon] starting `babel-node src/server.js --inspect=0.0.0.0:5859 --nolazy`
Debugger listening on ws://0.0.0.0:5859/5939f6b6-5ade-4ce5-9694-7df5f5b8385b
For help, see: https://nodejs.org/en/docs/inspector
VS Code Setup
And when I fire up the debug profile in VS Code it appears to attach. Below is line from the logs of the running docker container.
However, no breakpoints are hit when I set them. Is this a babel-node issue? Is there any suggested path forward to get node debugging to work with babel-node
?
My VS Code debug config:
{
"type": "node",
"request": "attach",
"name": "Docker: GraphQL",
"port": 5859,
"protocol": "inspector",
"restart": true,
"remoteRoot": "/app",
"localRoot": "${workspaceFolder}"
}