Skip to content

[Bug]: scripts/dev-runner.ts treats bind EPERM/EACCES as occupied ports until DevRunnerPortExhaustedError #43574

Done

Description

@royalaid

Problem

In \scripts/dev-runner.ts, \ indFirstAvailableOffset\ probes ports and treats every bind failure identically, scanning all the way to port 65535 and failing with \DevRunnerPortExhaustedError\ even when the OS denied socket binding with \EPERM\ or \EACCES\ (e.g. in a restricted sandbox).

Expected behavior

Preserve bind error codes during port availability probing:

  • Advance to the next offset only on \EADDRINUSE.
  • Abort immediately on \EPERM\ or \EACCES\ with a permission-specific diagnostic naming the error code and port.

Minimal repro

  1. Run
    ode scripts/dev-runner.ts dev\ in an environment where local socket binding fails with \EPERM.
  2. Observe it scans offsets to 65535 and throws \DevRunnerPortExhaustedError, whereas launching \�pps/server/src/bin.ts\ directly surfaces \listen EPERM\ immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions