Skip to content

✨ [Feature request]: Set the PORT number dynamically on local server. #1243

Closed as not planned

Description

@Hat52

Is your feature request related to a problem? Please describe.

When we try to create a new play on localhost and If we already have something running on port 3000 then the project successfully runs on a different port but when we hit the create play button it redirects to port 3000 which is not the intended port for the project.

Describe the solution you'd like.

The current solution wants us to set the port number in a .env file If we do that it will successfully open the new play form on that port but what I am suggesting is that we exclude the need to set an env variable for this specific purpose.

Describe alternatives you've considered.

none

Screenshot / Screenshare

inside CreatePaly file
image
This is the code that needs to be updated/

Additional context

none

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. github-actions commented on Sep 12, 2023

    @github-actions

    Hey! contributor, thank you for opening an Issue 🎉.

    @reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
    Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
    Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

  2. Hat52 commented on Sep 12, 2023

    @Hat52
    ContributorAuthor

    If this needs to be worked on then I would like to work on it.

  3. Hat52 commented on Sep 12, 2023

    @Hat52
    ContributorAuthor

    The attached screenshot has the port number 3001, I have changed that on local from 3000 to 3001

  4. atapas commented on Sep 20, 2023

    @atapas
    Member

    Please work on it.

  5. Angra974 commented on Sep 20, 2023

    @Angra974
    Contributor

    Be careful with this. You can start your app on port 3000. But process.env is not found for x reason, so you can't found process.env.RAECT_DEV_PORT logically.
    And if all is ok with process.env, this variable is not set in .env file, so it's logic it will not be found.
    This variable is never used in the application, so it always default to 3000 and it's the port use by cra, so the main app works without problem with this.

    By default CRA starts on port 3000 even if you change this variable.
    You can add the port in the start script but will need to be done in the main app.

    Best solution for you is to use command line with a tool like "kill-port"
    Here how i use the application on local "npx kill-port 3000 && pnpm start" or other package manager.

  6. Hat52 commented on Sep 20, 2023

    @Hat52
    ContributorAuthor

    Thanks for heads up

  7. github-actions commented on Oct 20, 2023

    @github-actions

    There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions