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

Automatically select port when starting #358

Closed
franzheidl opened this issue Dec 7, 2016 · 5 comments
Closed

Automatically select port when starting #358

franzheidl opened this issue Dec 7, 2016 · 5 comments

Comments

@franzheidl
Copy link

When starting next outputs this:

Ready on http://localhost:3000

Even if something else is already running on 3000. It would be great if next could detect that and then automatically use the next sensible free port (e.g. 3001).

@MoOx
Copy link
Contributor

MoOx commented Dec 7, 2016

It would be great if next could detect that and then automatically use the next sensible free port (e.g. 3001).

I am currently using this technique on a project (Phenomic) and I can tell the UX is not the best. Especially if you are already using your own project, just in another terminal/tab and you forget it.

create-react-app is doing something different and tells you that something (and who) is using the port and offer you a way to adjust it.
This UX seems a better choice (source: https://github.com/facebookincubator/create-react-app/blob/dc6edce99bc999252757114cb54721928abc28f1/packages/react-scripts/scripts/start.js#L294-L318)

@franzheidl
Copy link
Author

franzheidl commented Dec 7, 2016

Totally agree! The UX you proposede is in fact better than automatically selecting another port. The thing that is actually bugging me is thatt next.js does not reflect the fact 3000 is already in use, and thus creates output that is simply not correct/misleading.

@arunoda
Copy link
Contributor

arunoda commented Dec 7, 2016

Related discussion: #68

@MoOx
Copy link
Contributor

MoOx commented Dec 7, 2016

Oh that's exactly this. I guess this issue can be closed then?

@arunoda
Copy link
Contributor

arunoda commented Dec 7, 2016

I hope so. Let's talk more on that PR.

@arunoda arunoda closed this as completed Dec 7, 2016
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants