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

No error when port is already in use in (macOS) #5605

Closed
7 tasks done
frandiox opened this issue Nov 10, 2021 · 2 comments
Closed
7 tasks done

No error when port is already in use in (macOS) #5605

frandiox opened this issue Nov 10, 2021 · 2 comments

Comments

@frandiox
Copy link
Contributor

Describe the bug

Vite normally starts the server in the next available port when the default one is already in use. However, this seems to fail in some circumstances when running on a Mac (intel, at least).

Reported originally in Shopify/hydrogen#155

Reproduction

Run node -e 'require("http").createServer(function (req, res) {}).listen(3000);' in a terminal and then start any Vite server in the same port. Vite will show the port is 3000 instead of the expected 3001 but it won't be able to serve anything.

This, but run in on on macOS: https://stackblitz.com/edit/vitejs-vite-yhqcxn?file=package.json

System Info

System:
    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 5.91 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.5.0 - /opt/dev/sh/nvm/versions/node/v16.5.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 7.19.1 - /opt/dev/sh/nvm/versions/node/v16.5.0/bin/npm
    Watchman: 2021.10.18.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 95.0.4638.69
    Safari: 15.1

Used Package Manager

yarn

Logs

No response

Validations

@haoqunjiang
Copy link
Member

haoqunjiang commented Nov 10, 2021

Could you check if it's a duplicate of #5241 (comment)?

@frandiox
Copy link
Contributor Author

@sodatea Thanks! It looks indeed similar to what you describe in that comment. It works on 127.0.0.1:3000. Closing this as you are already tracking it there 👍

@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants