vercel/next.js · error

Port ${originalPort} is in use by an unknown process, using

Error message

Port ${originalPort} is in use by an unknown process, using available port ${port} instead.

What it means

Warning from startServer's listening handler when port retrying was enabled: the original port is in use but getProcessIdUsingPort could not identify an owning pid (e.g. a process outside the user's visibility or a race). The server nevertheless fell back to an available port and reports the substitution.

Source

Thrown at packages/next/src/server/lib/start-server.ts:343

          : addr
      )
      const formattedHostname =
        !hostname || actualHostname === '0.0.0.0'
          ? 'localhost'
          : actualHostname === '[::]'
            ? '[::1]'
            : formatHostname(hostname)

      port = typeof addr === 'object' ? addr?.port || port : port

      if (portRetryCount) {
        const pid = await getProcessIdUsingPort(originalPort)
        if (pid) {
          Log.warn(
            `Port ${originalPort} is in use by process ${pid}, using available port ${port} instead.`
          )
        } else {
          Log.warn(
            `Port ${originalPort} is in use by an unknown process, using available port ${port} instead.`
          )
        }
      }

      const networkHostname =
        hostname ?? getNetworkHost(isIPv6(actualHostname) ? 'IPv6' : 'IPv4')

      const protocol = selfSignedCertificate ? 'https' : 'http'

      const networkUrl = networkHostname
        ? `${protocol}://${formatHostname(networkHostname)}:${port}`
        : null

      const appUrl = `${protocol}://${formattedHostname}:${port}`

      // Store the selected port to:
      // - expose it to render workers

View on GitHub (pinned to 89d017eac4)

Solutions

  1. Free the original port (kill the owning process) if you need the server on that exact port.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/next/src/server/lib/start-server.ts:343 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@89d017eac4 (2026-08-19). Data as JSON: /api/errors/b045f323e0a69047. Report an issue: GitHub.