Cypress Application Code Error: Fix the Crash

updated November 10, 2026

Your test stops after a click. Read the error after >. Below it, the stack trace lists the functions that ran. Open the first line from your app, fix the error there and rerun the test.

The following error originated from your application code, not from Cypress.

Our test clicked Save. Cypress printed:

TypeError: The following error originated from your application code, not from Cypress.

  > Cannot set properties of null (setting 'textContent')

The first app line named HTMLButtonElement.save. That function looked for [data-status] and tried to write Saved into it. The page had no such element. We added <p data-status></p> to the page. The same test then passed and found the text Saved.

It was caused by an unhandled promise rejection.

This time the same error happened after the click handler returned. The app started a promise, and the work inside it failed. Cypress added this sentence:

TypeError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

Read the error after > here too. In our run, the missing status element still caused the failure. A global uncaught:exception handler that returns false would hide app errors from Cypress.

The following error originated from your test code, not from Cypress.

Open the test file named in the stack trace. Our file threw an error before it declared a test. Cypress reported:

Error: The following error originated from your test code, not from Cypress.

  > The test has no account fixture.

We checked Cypress 16.2.1 in Electron on macOS 15.4.1 and Debian 13 on 10 November 2026. The app errors matched in JavaScript and TypeScript, with CI=1 and with CI unset.

now prove it

Prove a contact was actually saved

Reading is the easy part. Write the test yourself, then we break the app on purpose to check it would really catch the bug.

Solve this problem →

Learn this in full

Reading about a problem is not the same as fixing one. Pick a lecture or a practice problem and write the test yourself.

Keep reading