Skip to content
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

Server won't run with port 0 (assigns any available port) #7529

Closed
7 tasks done
ahtcx opened this issue Mar 30, 2022 · 1 comment · Fixed by #7530
Closed
7 tasks done

Server won't run with port 0 (assigns any available port) #7529

ahtcx opened this issue Mar 30, 2022 · 1 comment · Fixed by #7530

Comments

@ahtcx
Copy link
Contributor

ahtcx commented Mar 30, 2022

Describe the bug

On most systems, starting a server on port 0 will assign any available port. Vite does not allow to provide port 0, and will instead fall back to the default port 3000.

Reproduction

https://stackblitz.com/edit/vitejs-vite-g65k5l?file=vite.config.ts&terminal=dev

Validations

@ahtcx
Copy link
Contributor Author

ahtcx commented Mar 30, 2022

This can be fixed by using nullish coalescing here instead of the or operator.

ahtcx added a commit to ahtcx/vite that referenced this issue Mar 30, 2022
@ahtcx ahtcx changed the title Server won't run with port 0 which will assign any available port Server won't run with port 0 Mar 30, 2022
@ahtcx ahtcx changed the title Server won't run with port 0 Server won't run with port 0 (assigns any available port) Mar 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant