ritwickdey / vscode-live-server

Launch a development local Server with live reload feature for static & dynamic pages.
https://ritwickdey.github.io/vscode-live-server
MIT License
5.57k stars 1.2k forks source link

Incorrectly defaults to higher port numbers #2924

Closed jacobflee closed 2 months ago

jacobflee commented 2 months ago

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):

Expected behavior

Live Server should:

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.

jacobflee commented 2 months ago

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.