I'm submitting a bug report regarding how Live Server selects which port to use.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->
Current behavior
I used Live Server to test css changes for a flask app I'm working on. I ran the flask server on port 5500, the same as Live Server's default port 5500. While the flask app was running on port 5500 I started Live Server, which recognized that port 5500 was already in use so it opened to port 5501 instead. I then closed both servers and started Live Server, which opened to port 5501 despite port 5500 being available.
Failed attempts to resolve issue (in order):
I closed the flask server and changed the Live Server settings.json file to include "liveServer.settings.port": 5500 but Live Server still opened to port 5501.
I ran the flask server on port 5501 then started Live Server, which opened to port 5502. I closed both servers then started Live Server which opened to port 5502.
I uninstalled Live Server to erase any potential port history, quit vscode, opened vscode, then reinstalled Live Server, but it now opens to port 5502.
I ran lsof -i :5500 in the terminal to see if port 5500 was in use but it isn't.
Expected behavior
Live Server should:
use the port specified in settings.json
if no port is specified then use default port 5500
if it is not available try the next incremental port until an available port is found
Environment
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
- [x] Arc (chromium based) v1.38.0
For Tooling issues:
- Live Server: v5.7.9
- Platform: Mac M1 Pro 13in 2020 Sonoma v14.3.1
- Visual Studio Code: v1.88.1
Others
This bug is not urgent. Live Server still works, it just annoys the everloving fuq out of me.
I resolved it! The .vscode settings.json was auto edited to "liveServer.settings.port": 5502 to push the ports higher. Thus the Live Server settings.json was overwritten.
I'm submitting a bug report regarding how Live Server selects which port to use.
Current behavior
I used Live Server to test css changes for a flask app I'm working on. I ran the flask server on port 5500, the same as Live Server's default port 5500. While the flask app was running on port 5500 I started Live Server, which recognized that port 5500 was already in use so it opened to port 5501 instead. I then closed both servers and started Live Server, which opened to port 5501 despite port 5500 being available.
Failed attempts to resolve issue (in order):
"liveServer.settings.port": 5500
but Live Server still opened to port 5501.lsof -i :5500
in the terminal to see if port 5500 was in use but it isn't.Expected behavior
Live Server should:
Environment
Others
This bug is not urgent. Live Server still works, it just annoys the everloving fuq out of me.