question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set property message of [object DOMException] which has only a getter

See original GitHub issue

Versions:

  • cypress-testing-library version: 8.0.1
  • node version: 12.22.6
  • npm version: 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

image

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:10
  • Comments:5

github_iconTop GitHub Comments

3reactions
MAfzalKhan1997commented, Nov 30, 2021

any update on above issue ?

0reactions
schester44commented, Jul 19, 2022

seeing this as well when using react-app-rewired and craco with a create react app application. very strange.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot set Property which has only a Getter in JS
The "Cannot set property which has only a getter" error occurs when trying to set a new value to a property, for which...
Read more >
Getting "cannot set property name of which has only a getter"
Nowhere in the code have I tried to set a property. Either way, it seems to throw the error before running my tests....
Read more >
TypeError: setting getter-only property "x" - JavaScript | MDN
The JavaScript strict mode-only exception "setting getter-only property" occurs when there is an attempt to set a new value to a property for...
Read more >
Cannot set property of #<Object> which has only a getter #587
The specific reason this happens is because assigning a property to an object where the property already exists on the prototype chain will ......
Read more >
Cannot set property material of [object Object] which has only ...
Cannot set property material of [object Object] which has only a getter ... I use AssetContainer.instantiateModelsToScene() clone the model.I need ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found