fix: Check port usage correctly (fix #6519)#6523
fix: Check port usage correctly (fix #6519)#6523dohooo wants to merge 4 commits intovitejs:mainfrom dohooo:feat/checkPortOccupied
Conversation
|
I added the corresponding tests. |
|
@Niputi thx |
Niputi
left a comment
There was a problem hiding this comment.
please move the test to the playground folder which contains the tests
ok |
|
I've already moved. Thanks for the tip. @Niputi |
|
the test is failing |
I see it looks like the dependency install failed how do I restart it? |
Test was passed. |
|
@dohooo I'm a bit confused. Port checking and using incremented ports are already available for dev and preview commands. It looks like the core issue is that Vite fails to detect port 5000 being occupied on macos, but I don't see how this change fixes it, can you elaborate on your changes here? |
The default host of vite dev server is 127.0.0.1. When I start the same port server on localhost, It can't detect occupancy. So I'll check the port on localhost again when host is 127.0.0.1. |
Description
fixed: #6519
I hope there is an accurate notification when a port is occupied, as this can take a lot of time for most novices to debug. He may not be able to tell if it's a problem with his business code or a problem with the project configuration.
Additional context
Should I continue to check localhost after checking for 127.0.0.1? Because we probably don't know if the user's 127.0.0.1 domain name is localhost either, although most of them are.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).