-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing library throws uncaught error #251
Comments
Seeing this as well! |
yup. back for me, too |
FWIW, I resolved this by upgrading to the newest version of Cypress. |
i'm using:
|
Interesting, that's the same setup as me. How are you actually importing in the commands for Cypress Testing Library? |
cypress/support/commands.js:
cypress/support/index.js:
cypress/e2e/spec-mytests.js
|
@seanmcquaid how are you importing commands? |
I got this error as well but turns out I was importing twice |
@tracy-ash - I don't think you need to import in your support directly to your tests? Let me try to get you my current set up in a bit |
I am using the newest versions of both Cypress and |
I finally fixed this. Thanks |
I'm still seeing it after upgrade to cypress v.12.5 (latest atm) and @testing-library/cypress v9.0.0. I don't use addQuery in my |
@apolonskiy confirm how many times you are importing the file (eg. might be |
@9jaGuy I only import it once in |
I solved this issue by removing all exports from the |
@vaclavGabriel I do not have any |
What does your |
@vaclavGabriel let allure; Cypress.on("uncaught:exception", err => { export const setTestCookies = () => { before(function () { beforeEach(function () { // bypass for pending cypress suites displaying at allure // Import commands.js using ES2015 syntax: require("cypress-xpath"); |
I don't think you need this line: |
@vaclavGabriel , thanks for help :) However, moving imports, commenting named import from same lib don't change anything (I also need that config for a code below, but I tried removing it - no change.).
This does not work either, I mean
UDP: I also tried commenting out ALL the other imports, leaving only import from commands once - no change :( |
@vaclavGabriel thanks again for help, I finally got to the point... My case solved. |
I ran into this problem and the solution was to move |
Ran into this too. It seems like a fault in the library to me. Why developer should need to care about a file having imports and exports (and potentially instantiating the library multiple times) is beyond me. |
Make sure, that the file importing |
cypress-testing-library
version: 9.0.0node
version: 18.12.1npm
(oryarn
) version: 9.2.0Relevant code or config
What you did:
I am unable to run Cypress test after upgrading to Cypress version 12+ and
@testing-library/cypress version 9.0.0
due to an uncaught error from the Cypress testing library.What happened:
Reproduction repository:
Problem description:
Suggested solution:
The text was updated successfully, but these errors were encountered: