Skip to content
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

An uncaught error was detected outside of a test #28490

Closed
Louisrivera5 opened this issue Dec 11, 2023 · 4 comments
Closed

An uncaught error was detected outside of a test #28490

Louisrivera5 opened this issue Dec 11, 2023 · 4 comments
Labels
stale no activity on this issue for a long period

Comments

@Louisrivera5
Copy link

Current behavior

Cypress Error _ TypeError 12 09 23

I currently studying Cypress for automation testing and encountered this error to all test cases I did, even simple ones.
I also tried adding this Cypress.on('uncaught:exception', () => { return false }) but it doesn't work. We already checked the codes I had in the VS but we don't see any errors or issues with it.

Here is a sample test ///

//cypress - Spec

describe ('handling mouseHover popUp', function () {

it('mouseover with selection',function() {
cy.visit("https://rahulshettyacademy.com/AutomationPractice/")

//cy.get('div.mouse-hover-content').invoke('show')
cy.contains('top').click({force:true})
cy.url().should('include','top')


})

})

We also reinstalling cypress and downgrading it but I'm still getting the same error.

I hope some could help me as I'm frustrated and cant proceed with my lectures.

Desired behavior

Cypress to run the test case, without error especially if we set a script to ignore this errors but it isn't working.

Test code to reproduce

///

//cypress - Spec

describe ('handling mouseHover popUp', function () {

it('mouseover with selection',function() {
cy.visit("https://rahulshettyacademy.com/AutomationPractice/")

//cy.get('div.mouse-hover-content').invoke('show')
cy.contains('top').click({force:true})
cy.url().should('include','top')


})

})

Cypress Version

13.6.1

Node version

Node.js 18.16.0

Operating System

Windows 11pro

Debug Logs

index-eeafcf55.js:133769 Console was cleared
index-eeafcf55.js:133765 TypeError: The following error originated from your test code, not from Cypress.

  > Cannot destructure property 'prevSubject' of 'options' as it is undefined.

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.
    at Object.add (http://localhost:58345/__cypress/runner/cypress_runner.js:111004:11)
    at <unknown> (http://localhost:58345/__cypress/runner/cypress_runner.js:110821:23)
    at tryCatcher (http://localhost:58345/__cypress/runner/cypress_runner.js:1807:23)
    at Object.gotValue (http://localhost:58345/__cypress/runner/cypress_runner.js:6476:18)
    at Object.gotAccum (http://localhost:58345/__cypress/runner/cypress_runner.js:6465:25)
    at Object.tryCatcher (http://localhost:58345/__cypress/runner/cypress_runner.js:1807:23)
    at Promise._settlePromiseFromHandler (http://localhost:58345/__cypress/runner/cypress_runner.js:1519:31)
    at Promise._settlePromise (http://localhost:58345/__cypress/runner/cypress_runner.js:1576:18)
    at Promise._settlePromiseCtx (http://localhost:58345/__cypress/runner/cypress_runner.js:1613:10)
    at <unknown> (http://localhost:58345/__cypress/runner/cypress_runner.js:2382:20)
From previous event:
    at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (http://localhost:58345/__cypress/runner/cypress_runner.js:3486:19)
    at Promise._then (http://localhost:58345/__cypress/runner/cypress_runner.js:1239:17)
    at Promise.then (http://localhost:58345/__cypress/runner/cypress_runner.js:1132:17)
    at runScriptsFromUrls (http://localhost:58345/__cypress/runner/cypress_runner.js:110825:136)
    at Object.runScripts (http://localhost:58345/__cypress/runner/cypress_runner.js:110866:12)
    at $Cypress.onSpecWindow (http://localhost:58345/__cypress/runner/cypress_runner.js:40889:67)
logError @ index-eeafcf55.js:133765
(anonymous) @ index-eeafcf55.js:146109
emit2 @ index-eeafcf55.js:139474
(anonymous) @ cypress_runner.js:182072
emit @ cypress_runner.js:146867
emit @ cypress_runner.js:182135
onPrint @ cypress_runner.js:198274
_onPrintClick @ cypress_runner.js:198278
(anonymous) @ cypress_runner.js:197978
executeAction @ cypress_runner.js:180777
n @ cypress_runner.js:180777
ca @ cypress_runner.js:245
ja @ cypress_runner.js:246
ka @ cypress_runner.js:246
wa @ cypress_runner.js:248
Aa @ cypress_runner.js:249
ya @ cypress_runner.js:249
Da @ cypress_runner.js:252
Ad @ cypress_runner.js:315
Gi @ cypress_runner.js:481
Kb @ cypress_runner.js:270
Dd @ cypress_runner.js:317
(anonymous) @ cypress_runner.js:482
exports.unstable_runWithPriority @ cypress_runner.js:537
Ii @ cypress_runner.js:482
Cd @ cypress_runner.js:316

Other

Im new to cypress and javascript so I hope you can help me.

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jun 9, 2024
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
@Louisrivera5
Copy link
Author

its all good now, how can i close this

@MikeMcC399
Copy link
Contributor

@Louisrivera5
See Closing an issue and button below ⬇️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

3 participants