Skip to content
Latchkey

Cypress "could not verify that this server is running" in CI

When baseUrl is set, Cypress pings it before the run and stops if it gets no response. This is a stricter, earlier version of the cy.visit ECONNREFUSED failure: the server must be up at the configured URL before Cypress even opens.

What this error means

Cypress exits at startup with "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."

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`.

Cypress automatically waits until your server is accessible before running tests.

Common causes

The server is not up at baseUrl yet

Cypress polled baseUrl for the retry window and never got a response, so it gives up before running specs.

baseUrl is wrong or unreachable from the container

Pointing at localhost when the app runs in a sibling service container (or the wrong port) makes the probe fail.

How to fix it

Start the server and wait before Cypress

  1. Launch the app in the background in the same job.
  2. Block on the URL with wait-on (or the action's wait-on input).
  3. Run Cypress only after the URL responds.
.github/workflows/ci.yml
- uses: cypress-io/github-action@v6
  with:
    start: npm run start
    wait-on: 'http://localhost:3000'

Use a reachable baseUrl across services

When the app runs in a separate service container, target it by service name, not localhost.

cypress.config.js
e2e: { baseUrl: 'http://web:3000' },

How to prevent it

  • Always pair start with wait-on so the server is verified up.
  • Use service hostnames, not localhost, across container networks.
  • Keep baseUrl and the server bind address in sync.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →