Node remote debug with docker-compose no longer works Intellij 2021.3.2 Build #IU-213.6777.52

The Node remote debugger no longer works with Docker Compose. A new container is created without closing the existing containers and no ports are assigned even though there are ports defined in the docker-compose.yml file. Since no ports are bound, the container can't be reached even though the logs show that the app is running. This same configuration was working a few weeks ago.

I would expect that, when clicking the debug button, the old running container would be stopped and a new container be loaded.

A Docker server is set up using Docker for Windows. Configuration files being used are a docker-compose.yml and docker-compose.override.yml file in the root of the project. The service is detected and selected correctly. The image used is a slightly modified node:14.15.1-alpine.

How do I get the remote debugger set up using Docker Compose?

6 comments
Comment actions Permalink

Port bindings work fine for me when debugging with docker-compose. What IDE version do you use< what do you Dockerfile and docker-compose.yml look like? Sample project the issue can be repeated with would be helpful

 

Also, could you check if it's still an issue for you in  2022.1 EAP? It allows changing Docker Compose settings in run configuration UI.

0
Comment actions Permalink

I'm not sure what other version of the IDE you are looking for than what is already mentioned in the title of the post. It's Ultimate Edition if that helps.

I added images below of the docker-compose.yml file and Dockerfile. I also added terminal output after running the command `docker ps`. The containers with hashes in their names were created from Intellij when clicking the debug button for the run configuration. The app container with ports is from running `docker-compose up -d` from the terminal and not from clicking the debug button. I would have expected all running instances be stopped/downed before a new one is created because that's how it was working before but new instances just keep being created.

The run configuration is shown below as well and is nothing special. I did originally need to have a before launch script to run npm install beforehand but that stopped working too due to the IDE not being able to find the `npm` command. The Node interpreter is supposed to be using the one installed inside the image specified by the docker-compose.yml file

docker-compose.yml:

Dockerfile:

Terminal output for docker ps:

Run configuration:

Debug window output (canceled after clicking the stop button next to the debug button next to the run configuration selector):

0
Comment actions Permalink

Can you please try 2022.1 EAP? It uses docker-compose up instead of docker-compose run (WEB-54160). Will it help?

1
Comment actions Permalink

The EAP build does work for debugging using docker-compose.yml files. When will this be released to the main release branch for Intellij?

0
Comment actions Permalink

It can be expected in the middle of April

0
Comment actions Permalink

OK, I can use the EAP version for Node projects for now. You can close this issue.

0

Please sign in to leave a comment.