-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Showing port number are different between Vite and Kit if 3000 is already in use #2467
Comments
The duplicated welcome messages likely came from #2232, I think the best case is if we can replace |
When I create #2441, you said we can use a port dynamically after merge #2232. And if we should stop a server if port 3000 is already in use, |
I don't think SvelteKit should have port checking code since it already exists in Vite. But it's there and it's surprising to me that it's not working on your machine. It does work for me on Linux. I guess it doesn't work on Windows. But anyway, we should probably remove that code |
I sent a PR to Vite to remove the log messages that it's printing: vitejs/vite#5016 We should still remove our port choosing logic in favor of Vite's |
Do we want to remove the log messages entirely? We wouldn't know what the URL is ahead of time if |
I was thinking we'd update our code to check what port the server was running on after it started |
Ah if there's a way to get the port after |
This is just an update current situation. vitejs/vite#5016 was merged (Thank you @benmccann). dev
The duplicate message is gone👍. So we should change args for const { server } = watcher.vite.config;
welcome({ port: server.port, host: server.host, https: host.https, open }); PreviewIf 3000 is free, it works fine.
But 3000 is already in use, below error comes (I'm using Windows10).
|
Thanks to vitejs/vite#5014, we can use Vite's For |
Oh sorry, I forgot about vitejs/vite#5014. We should both |
Describe the bug
When I run
npm run dev
in kit project,Different port shows if 3000 is already in use as you can see from the log.
Reproduction
After use 3000 port by some process, run this commands.
Logs
System Info
Severity
annoyance
Additional Information
Maybe
packages\kit\src\cli.js#welcome
should be removed most of the code??https://github.com/sveltejs/kit/blob/master/packages/kit/src/cli.js#L217
And the output should be like this?
Thank you.
The text was updated successfully, but these errors were encountered: