Cannot set property message of [object DOMException] which has only a getter
Versions:
-
cypress-testing-libraryversion: 8.0.1 -
nodeversion: 12.22.6 -
npmversion: 6.14.15
What you did: I tried to get an element using the cy.findByRole command
What happened:
TypeError: Cannot set property message of [object DOMException] which has only a getter
TypeError: Cannot set property message of [object DOMException] which has only a getter
at modifyErrMsg (http://localhost:3002/__cypress/runner/cypress_runner.js:172545:15)
at $Cy.retry (http://localhost:3002/__cypress/runner/cypress_runner.js:164808:33)
at onFailFn (http://localhost:3002/__cypress/runner/cypress_runner.js:148305:21)
From previous event:
at $Cy.verifyUpcomingAssertions (http://localhost:3002/__cypress/runner/cypress_runner.js:148312:105)
From previous event:
at tryFn (http://localhost:3002/__cypress/runner/cypress_runner.js:165332:61)
at whenStable (http://localhost:3002/__cypress/runner/cypress_runner.js:165371:14)
at http://localhost:3002/__cypress/runner/cypress_runner.js:164858:18

Problem description: I am getting the error above when using findByRole from Cypress Testing Library
Suggested solution: Rollback to the version 7.0.7 helps
any update on above issue ?
I'm having the same issue
same here 😢
any solutions?
seeing this as well when using react-app-rewired and craco with a create react app application. very strange.
I had the same issue. I rolled back to v7.0.7, which indeed solves it, but of course I'd rather use the latest version. It doesn't look like there's much developer activity here, though :(
Same issue discovered with this Cypress version:
Cypress package version: 12.2.0 Cypress binary version: 12.2.0 Electron version: 21.0.0 Bundled Node version: 16.16.0
Cypress 12.14.0 Node 16.20.1
Still encounter this issue today. so I removed all the test and found:
- describe('Description', () => {}) => this works fine
- describe('Description', () => { it('should works fine', () => {}) }) => this is failed with the above error
Still not sure what is blocking this test
Having this issue in Firefox, but in Electron it works fine:
Cypress 12.17.4 Firefox 117.0.1 Electron 106
Same issue when upgrading from @testing-library/react: 14.1.2 to higher.
Node 20.11 Cypress: 13.6.6 Typescript 5.2