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:
- Spin up something on port 3000 locally (like another docker container)
- 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
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
appPortbecause it actually errors if the port is already in use.Repro:
"forwardPorts": [3000].Expected: Notified that a different local port was used, or it errors
Actual: No notice, no error