Skip to content

Check for port conflict before compilation in npm start #6806

@TomasHubelbauer

Description

@TomasHubelbauer

I'd like to suggest that CRA attempts to pre-bind the port it is configured to run on when doing npm start before compilation starts. The compilation is slow and I often forget I have a different CRA running on 3000 (I use the default) already, so it costs some time to find out only after the server attempts to start and have to kill the hog and restart the compilation.

Obviously doing this check would still leave a window where if it passes pre-compilation, the process can be bound during the compilation, but I believe the current behavior is find in that case. Checking pre-emptively before compilation should catch approximately 100.0% of cases where you forgot to kill a different process on the desired port.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions