GithubHelp home page GithubHelp logo

--port=4200 not working about ember-cli HOT 7 CLOSED

amk221 avatar amk221 commented on June 1, 2024
--port=4200 not working

from ember-cli.

Comments (7)

NullVoxPopuli avatar NullVoxPopuli commented on June 1, 2024

This happens when port 4200 is already in use, and you'd otherwise have an error, and your dev server would not start (two servers are not allowed to run on the same port at the same time).

If you don't have a duplicate server on 4200 running, let me know!

from ember-cli.

amk221 avatar amk221 commented on June 1, 2024

If I ask for a specific port and its not available, shouldn't it error? As in, I'd only expect auto-behaviour when no port is specified

from ember-cli.

NullVoxPopuli avatar NullVoxPopuli commented on June 1, 2024

Nay, because you want to get to developing, and if you do run multiple prajects on your computer, it's a convenience to just get to your work, rather guessing a new port.

Here is the implementation pr for discussion: #10394

from ember-cli.

amk221 avatar amk221 commented on June 1, 2024

Fair enough. I can work with that, it just means our work flow might change.

Spin up watchers

cd app1
npm run watch          # port 4200
npm run watch:tests    # port 4201
cd app2
npm run watch          # port 4300
npm run watch:tests.   # port 4301

The difference being that now, developers can accidently do:

cd app1
npm run watch          # port 4201     CLASH: app server running on test server location

from ember-cli.

NullVoxPopuli avatar NullVoxPopuli commented on June 1, 2024

Anything goofy with the watch modes always booting, rather than erroring?

Do you have other tools that are expecting fixed port numbers?

from ember-cli.

Windvis avatar Windvis commented on June 1, 2024

If I ask for a specific port and its not available, shouldn't it error? As in, I'd only expect auto-behaviour when no port is specified

This is what I also would expect to happen and is what the PR description mentions as well:

ember serve will now automatically choose a port (starting with 4200), unless a port is explicitly set with the --port flag or the $PORT env variable.

I haven't tried it, but looking at the implementation I would expect --port 4201 to throw an error if that port is already in use, instead of selecting a different one automatically. So I do think it's a bug that the default port (4200) doesn't do that.

Unrelated, but it probably would also be a lot clearer if an extra message was displayed when a port is occupied and a different one was selected.

from ember-cli.

NullVoxPopuli avatar NullVoxPopuli commented on June 1, 2024

I can get behind that -- would you be willing to open a PR?

from ember-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.