Cypress baseUrl "ECONNREFUSED" - Server Not Running in CI
By Kaveh Alemi·Latchkey
Cypress probed your baseUrl and the connection was refused. The app server was never started in CI, is still booting, or baseUrl points where nothing is listening.
What this error means
Cypress aborts at startup with "Cypress could not verify that this server is running" and retries the URL before giving up with ECONNREFUSED. Specs never run because the app is unreachable.
cypress
Cypress could not verify that this server is running:
> http://localhost:3000
We are verifying this server because it has been configured as your
baseUrl. ... connect ECONNREFUSED 127.0.0.1:3000
Common causes
App server not started before Cypress
The CI step ran cypress run without first starting (and waiting for) the dev/preview server, so nothing answers at baseUrl.
Server still booting (race)
The app was launched in the background but Cypress probed before it finished compiling/listening - a timing race that often clears on retry.
Wrong baseUrl or port
baseUrl does not match where the app listens (wrong port, 127.0.0.1 vs localhost, or a container hostname).
How to fix it
Start the server and wait for it
Use start-server-and-test (or wait-on) so Cypress runs only once the URL responds.
Always gate cypress run behind start-server-and-test/wait-on.
Keep baseUrl and the server port in one shared config value.
Give the server a generous readiness timeout on slow CI.
Frequently asked questions
What causes ""ECONNREFUSED" baseUrl"?
The CI step ran cypress run without first starting (and waiting for) the dev/preview server, so nothing answers at baseUrl.
How do I fix "ECONNREFUSED" baseUrl?
Use start-server-and-test (or wait-on) so Cypress runs only once the URL responds.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.