nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.17k stars 2.3k forks source link

Why can't I debug more then one app at a time? Port 9229 address already in use. #18179

Open brandoncollins7 opened 1 year ago

brandoncollins7 commented 1 year ago

Current Behavior

Unless I manually provide a custom --port=12345 for each of my apps, I cannot debug more then one at a time. I've never had this issue with all my apps before nx.

Expected Behavior

Nx should assign a random debug port to each application automatically.

GitHub Repo

No response

Steps to Reproduce

  1. Use Intellij debug mode to run two nx apps at the same time.

Nx Report

Node   : 18.15.0
   OS     : win32-x64
   pnpm   : 7.32.2

   nx (global)        : 16.1.4
   nx                 : 16.5.3
   @nx/js             : 16.5.3
   @nx/jest           : 16.5.3
   @nx/linter         : 16.5.3
   @nx/workspace      : 16.5.3
   @nx/cypress        : 16.5.3
   @nx/devkit         : 16.5.3
   @nx/esbuild        : 16.5.3
   @nx/eslint-plugin  : 16.5.3
   @nx/nest           : 16.5.3
   @nx/next           : 16.5.3
   @nx/node           : 16.5.3
   @nx/react          : 16.5.3
   @nx/storybook      : 16.5.3
   @nx/vite           : 16.5.3
   @nx/web            : 16.5.3
   @nx/webpack        : 16.5.3
   nx-cloud           : 16.1.0
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   @nx-tools/nx-container : 5.0.2
   @nx-tools/nx-prisma    : 5.0.2

Failure Logs

No response

Operating System

Additional Information

No response

dudilugasi commented 1 year ago

same

brandoncollins7 commented 1 year ago

Anyone? How to assign random debug ports?

mandarini commented 10 months ago

Hi there @brandoncollins7 ! Can you please create a minimum reproduction repository for this?

On Nx, we do support you setting the port manually, as you described, in the server you are using. So, in your project.json you can set a port and Nx will respect that. If you can create a repo, I can take a look, in any case!

I understand that you would like Nx to suggest switching ports if a port is already being used, but the port detection happens on runtime, and when it gets handled, it gets handled by the builder/server being used.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏