zendesk / zcli

A command-line tool for Zendesk
https://developer.zendesk.com
Apache License 2.0
56 stars 18 forks source link

ZCLI theme and apps uses same port #205

Closed verschoren closed 5 months ago

verschoren commented 10 months ago

Expectations

I can run zcli apps:server and zcli theme:preview concurrently for both changing a theme and an app that runs in Agent environment.

useful for integrations (e.g. custom objects) that run on both the Help Center and a sidebar app for Agents.

Reality

I get a port collision error

zcli themes:preview

Uploading theme... Ok
node:events:368
      throw er; // Unhandled ‘error’ event
      ^
Error: listen EADDRINUSE: address already in use 127.0.0.1:4567
    at Server.setupListenHandle [as _listen2] (node:net:1334:16)
    at listenInCluster (node:net:1382:12)
    at GetAddrInfoReqWrap.doListen [as callback] (node:net:1520:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8)
Emitted ‘error’ event on WebSocketServer instance at:
    at Server.emit (node:events:390:28)
    at emitErrorNT (node:net:1361:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: ‘EADDRINUSE’,
  errno: -48,
  syscall: ‘listen’,
  address: ‘127.0.0.1’,
  port: 4567
}

Steps to Reproduce

run zcli apps:server and zcli theme:preview on an app and theme at the same time

luis-almeida commented 9 months ago

Hi @verschoren, Both commands accept a --port flag which should allow for starting them on different ports and avoid the collision error.