Debugging Reference

Cypress Errors

Cypress logo

10 common Cypress errors with verified solutions.

CypressError: cy.visit() failed

cy.visit() failed to load the target URL. The server may be unreachable, or the response status code indicates an error.

critical

CypressError: Timed out retrying after 4000ms

A Cypress command timed out while retrying. Cypress automatically retries assertions until the timeout, then fails. The default is 4 seconds.

high

CypressError: Expected to find element but never found it

Cypress could not find any element matching the selector within the timeout period. The element may not exist, may have a different selector, or may not have been rendered yet.

high

CypressError: element has been detached from the DOM

The element that Cypress was interacting with was removed from the DOM and re-rendered. This is common in React/Vue/Angular apps where components re-render.

medium

CypressError: cy.request() failed

cy.request() failed because the server returned an error, the connection was refused, or the request timed out.

high

AssertionError: expected true to equal false

A Chai assertion in Cypress failed because the actual value did not match the expected value. This is the most common test failure type.

medium

CypressError: An uncaught error was detected outside of a test

The application under test threw an uncaught JavaScript error. Cypress catches these and fails the test to alert you of application bugs.

high

CypressError: cy.origin() — Visiting a cross-origin URL

Cypress cannot visit a different domain within the same test by default. Cross-origin navigation requires the cy.origin() command.

medium

CypressError: A fixture file could not be found

cy.fixture() could not find the specified fixture file in the cypress/fixtures directory.

low

CypressError: Cypress does not support multiple tabs

Cypress cannot interact with multiple browser tabs. Links with target='_blank' will open in the same tab if visited directly.

low