“Aw, Snap!” errors in Chrome under Cypress

chrome-aw-snap-error-fix.png

This has started happening with my test scripts, presumably due to one or more upgrades of Chrome. It took a bit of tinkering, but the way to resolve this appears to be by adding the following line to the cypress.json file:


”numTestsKeptInMemory”: 0

Once this was added the errors stopped.

Note: Setting this to zero prevents Cypress’ “look-back” feature from working as the test is no longer in memory.

Note 2: There is an open bug on Cypress’ Github regarding this same issue affecting Cypress 10.x and above. It is for this reason that we never upgraded past 9.4.0. See https://github.com/cypress-io/cypress/issues/21135

Staying on 9.4.0 kept the built-in Electron browser under v100 and prevented this issue from appearing during testing.

Previous
Previous

Using Cypress to check CSS

Next
Next

Parsing XLSX files using Cypress