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 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
- Launch the app in the background in the same job.
- Block on the URL with wait-on (or the action's
wait-oninput). - Run Cypress only after the URL responds.
- 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.
e2e: { baseUrl: 'http://web:3000' },How to prevent it
- Always pair
startwithwait-onso the server is verified up. - Use service hostnames, not localhost, across container networks.
- Keep
baseUrland the server bind address in sync.