-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Check port usage correctly (fix #6519) #6523
Conversation
I added the corresponding tests. |
@Niputi thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
).