Skip to content

Using forwardPorts gives no indication that a different port was used #2249

Description

@Chuxel

I hit a problem where I had port 3000 running locally, and then opened a dev container with "forwardPorts": [3000]. Since the port conflicted, the port was actually mapped to 3001 locally. However, I had no idea, and couldn't figure out why updates weren't taking effect. I finally realized what was going on.

This doesn't happen with appPort because it actually errors if the port is already in use.

Repro:

  1. Spin up something on port 3000 locally (like another docker container)
  2. Create a devcontainer.json that points to "forwardPorts": [3000].

Expected: Notified that a different local port was used, or it errors
Actual: No notice, no error

Metadata

Metadata

Labels

containersIssue in vscode-remote containersunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions