-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Port conflict #9133
Comments
There is Another problem is passing |
@bluwy surprising to me, we are fully using Vite for preview server now, right? |
We use Vite's preview server for |
When using an adapter,
I submitted a PR to fix that #9545. Technically it's not a port conflict behaviour as both servers are served under ipv4 and ipv6 respectively, but it is indeed inconsistent so I updated it.
I don't think we need new options for those unless you can show an environment where you can't pass env vars today. But I believe most enviroments should allow that in some form. I've skipped this in the PR for now as I think it's also out-of-scope. |
New option to auto increment is possible? It is for previewing in development without stopping the dev server.
I did not know that can it be included to command help menu?
Some companies environment don't let developers customize env vars. It's a limitation they add that makes difficulty.
|
As mentioned, the problem is that different preview implementations are not expected to auto-increment today. Even if we add a new option, it doesn't make auto-increment work. They still need to implement themselves.
We can definitely add them. Looks like it's missed out in the list. |
@ematipico host and port can already be passed in https://github.com/withastro/astro/blob/main/packages/integrations/node/src/index.ts#L47. Can you move ...userOptions to the end so it can be override? |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Start
astro dev
and it start on 4321. Startastro dev
again and it start on next available port 4322.Run
astro preview
and there is errorEADDRINUSE: address already in use ::1:4321
.Run
node dist/server/entry.mjs
and it say[@astrojs/node] Server listening on http://127.0.0.1:4321
even though process already running on 4321.What's the expected result?
astro preview
should open on next available port 4322.node dist/server/entry.mjs
should have errorEADDRINUSE: address already in use ::1:4321
.astro preview
should have command line option--port
and astro config file option to change port to try first.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-1o5lsw
Participation
The text was updated successfully, but these errors were encountered: