-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot attach debugger to a node.js application running inside a Docker container #59
Comments
VS Code assumes that the (absolute) file paths returned from node.js, can be found in the filesystem where VS Code runs. As long as node.js runs on the same system as VS Code, this is always the case. We are planning to improve this path mapping soon. Until that has happened, can you try tweak your setup, so that the docker paths are valid paths on your host system too? (e.g. by using symbolic links). |
Thanks for getting back to me so fast. I already tried the symlinking approach and everything mentioned in this Stack Overflow post (notice that although the question is 0.8, the issues persist) but could not get it to work in any constellation. Should symlinking work in theory (i.e. has anyone of you ever managed to debug a node app inside a container yet)? |
This issue was moved to microsoft/vscode-node-debug#8 |
This is late to the game but I just ran into this issue. Make sure your remoteRoot node and localRoot node in your launch.json point to the proper location. I have a situation where I develop in a /lib folder and in my Docker file the files are put in a /app folder. This is how my launch.json is configured...
The debugger will attach properly then. |
I'm trying to attach the Visual Studio Code debugger to a node.js app that is running inside a Docker container.
The app starts like:
My
docker-compose.yml
exposes the port for attaching:launch.json
is pretty simple:Now, when I start the application and attach the debugger this will correctly connect (I can see the values flashing in the debugger UI already), but then it will stop, telling me the following:
Is there any way to fix this path offset? Should one handle this scenario completely different?
The text was updated successfully, but these errors were encountered: