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

Cypress says an error came from my application code, but it didn't #7934

Closed
crfrolik opened this issue Jul 9, 2020 · 2 comments
Closed

Cypress says an error came from my application code, but it didn't #7934

crfrolik opened this issue Jul 9, 2020 · 2 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@crfrolik
Copy link

crfrolik commented Jul 9, 2020

Current behavior:

I'm getting the following error in one of my tests:

> Cannot set property 'err' of undefined

It also says:

The following error originated from your application code, not from Cypress.

However, the stack trace contains only cypress code:

    at hookFailed (http://localhost:4200/__cypress/runner/cypress_runner.js:172588:13)
    at Runner.<anonymous> (http://localhost:4200/__cypress/runner/cypress_runner.js:172781:15)
    at Runner.emit (http://localhost:4200/__cypress/runner/cypress_runner.js:51598:8)
    at Runner.fail (http://localhost:4200/__cypress/runner/cypress_runner.js:171695:11)
    at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.failHook (http://localhost:4200/__cypress/runner/cypress_runner.js:103709:9)
    at Hook.<anonymous> (http://localhost:4200/__cypress/runner/cypress_runner.js:103746:15)
    at Hook.emit (http://localhost:4200/__cypress/runner/cypress_runner.js:51593:6)
    at multiple (http://localhost:4200/__cypress/runner/cypress_runner.js:103165:13)
    at Hook.done [as callback] (http://localhost:4200/__cypress/runner/cypress_runner.js:103179:15)
    at <unknown> (http://localhost:4200/__cypress/runner/cypress_runner.js:171746:17)
From previous event:
    at run (http://localhost:4200/__cypress/runner/cypress_runner.js:167214:20)
    at $Cy.cy.<computed> [as visit] (http://localhost:4200/__cypress/runner/cypress_runner.js:167666:12)
    at Context.runnable.fn (http://localhost:4200/__cypress/runner/cypress_runner.js:167891:22)
    at callFn (http://localhost:4200/__cypress/runner/cypress_runner.js:103248:22)
    at Test.../driver/node_modules/mocha/lib/runnable.js.Runnable.run (http://localhost:4200/__cypress/runner/cypress_runner.js:103235:8)
    at <unknown> (http://localhost:4200/__cypress/runner/cypress_runner.js:173106:29)
From previous event:
    at Object.onRunnableRun (http://localhost:4200/__cypress/runner/cypress_runner.js:173094:21)
    at $Cypress.action (http://localhost:4200/__cypress/runner/cypress_runner.js:163887:62)
    at Test.Runnable.run (http://localhost:4200/__cypress/runner/cypress_runner.js:171707:14)
    at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.runTest (http://localhost:4200/__cypress/runner/cypress_runner.js:103907:11)
    at <unknown> (http://localhost:4200/__cypress/runner/cypress_runner.js:104033:13)
    at next (http://localhost:4200/__cypress/runner/cypress_runner.js:103816:15)
    at <unknown> (http://localhost:4200/__cypress/runner/cypress_runner.js:103826:8)
    at next (http://localhost:4200/__cypress/runner/cypress_runner.js:103728:15)
    at <unknown> (http://localhost:4200/__cypress/runner/cypress_runner.js:103794:6)
    at timeslice (http://localhost:4200/__cypress/runner/cypress_runner.js:97720:28)

It's not clear what behavior my application is doing that is triggering this, so I think the error message could be improved. I'm still trying to pin down exactly what the root cause is.

Desired behavior:

Cypress shouldn't say that the error came from my code if it didn't. If it is obscuring an error from my code, it should print that error instead.

Test code to reproduce

Still working on this...

Versions

Cypress 4.10.0

@crfrolik
Copy link
Author

crfrolik commented Jul 9, 2020

If I close the test runner and restart it, the problem doesn't occur. I'm starting to think this is a deeper bug in Cypress... perhaps related to #7874?

@jennifer-shehane
Copy link
Member

Yah, this looks like a duplicate of #7874.

@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants