{"record":{"id":"7465b20112c42770","repo":"quasarframework/quasar","slug":"setting-port-to-closest-one-available-openpor","errorCode":null,"errorMessage":"️️Setting port to closest one available: ${openPort}","messagePattern":"️️Setting port to closest one available: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app-vite/lib/quasar-config-file.js","lineNumber":258,"sourceCode":"async function onAddress({ host, port }, mode) {\n  if (\n    ['cordova', 'capacitor'].includes(mode) &&\n    (!host || localHostList.includes(host.toLowerCase()))\n  ) {\n    if (cachedExternalHost) {\n      host = cachedExternalHost\n    } else {\n      const { getExternalIP } = await import('./utils/get-external-ip.js')\n      host = await getExternalIP()\n      cachedExternalHost = host\n    }\n  }\n\n  try {\n    const openPort = await findClosestOpenPort(port, host)\n    if (port !== openPort) {\n      warn()\n      warn(`️️Setting port to closest one available: ${openPort}`)\n      warn()\n\n      port = openPort\n    }\n  } catch (err) {\n    warn()\n\n    if (err.message === 'ERROR_NETWORK_PORT_NOT_AVAIL') {\n      warn(\n        'Could not find an open port. Please configure a lower one to start searching with.'\n      )\n    } else if (err.message === 'ERROR_NETWORK_ADDRESS_NOT_AVAIL') {\n      warn(\n        'Invalid host specified. No network address matches. Please specify another one.'\n      )\n    } else {\n      warn('Unknown network error occurred')\n      console.error(err)","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/quasar-config-file.js#L240-L276","documentation":"This is a warning emitted by quasar-config-file's onAddress: the devServer port configured in quasar.config is already occupied, so Quasar scans for the closest free port (findClosestOpenPort) and announces it will use that instead. It is informational, not a failure — the dev server just starts on a different port.","triggerScenarios":"Starting `quasar dev` (any mode that verifies the address) while the configured devServer.port is taken by another process; onAddress runs through onAddress->to during #computeConfig when opts.verifyAddress is set.","commonSituations":"Another dev server or stale node process still holding the port; two Quasar projects run simultaneously with the same port; a service (e.g. another app on 9000) occupying the default port; after a crash the OS hasn't released the socket yet.","solutions":["Accept the new port — Quasar already switched; just note the printed URL.","Free the port: kill the process holding it (lsof -i :PORT / netstat) then restart.","Set a permanently free devServer.port in quasar.config to avoid the drift.","If it happens every run, find the leeching service or change the defaultPortMapping by pinning an explicit port."],"exampleFix":"// before (quasar.config)\ndevServer: { port: 9000 } // occupied by another app\n// after\ndevServer: { port: 9100 } // free port for this project","handlingStrategy":"validation","validationCode":"// Before starting dev, verify the port is free:\nimport { createServer } from 'node:net'\nconst srv = createServer()\nsrv.once('error', () => console.warn('port busy'))\nsrv.listen(9000, () => srv.close())","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assign each project a distinct devServer.port.","Kill zombie dev processes (lsof -i :<port>) before starting.","Pin explicit ports in CI to keep URLs predictable.","Don't run two Quasar dev servers with default ports concurrently."],"tags":["network","port-conflict","dev-server"],"backgroundTag":"port-already-in-use","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}