-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
"Cannot set property 'err' of undefined" error occurs in place of other errors during automatic test-reruns on file save. #7874
"Cannot set property 'err' of undefined" error occurs in place of other errors during automatic test-reruns on file save. #7874
Comments
I can confirm that this issue shows up (not sporadic, but as soon as something is "hot-reloaded/refreshed"), and does not appear in 4.5.0. |
I can verify this behavior - if you save the file really early in the test running, the Can reproduce from the code in this repo as explaind: https://github.com/primitiveconcept/ludumdare46/tree/cypress/err-of-undefined/client If I run this in 4.5, the tests keep locking up for me, so I wouldn't say 4.5 is a working version. |
I always get this when it's detecting a change and re-running the tests. Even if the previous test-run has finished running a long time ago |
Should I open a separate issue for the At work, this was introduced with an upgrade to 4.6.0, but we just assumed it was something in our code causing it. I'm guessing that's why it hasn't been reported until now. |
The bug is annoying, but I'm more concerned that the error message is lying to us, implying that the error came from our code when it really came from cypress. Should there be another issue to address that? |
Same issue with 4.11.0. |
This error is being thrown from here: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cypress/runner.js#L550 Sometimes the So the question is, why is it failing to find the test here in this hook? It just doesn't have this I can get this |
For me it happens every time after the first re-run. The initial run passes with no issues and all the subsequent are failing with this error, even if no files are changed - just a simple re-run triggered by the button in cypress UI. I end up returning false from the 'uncaught:exception' hook to suppress this error temporarily, so the tests are passing on re-run. "cypress": "4.10.0" |
I could cut that example down quite a bit if that would help. |
This is happening to me after upgrading from v4.10.0 to v4.11.0. |
I'm working on this. We might have already fixed as part of #8113 (unfortunately didn't make it into last release), and I'm working on getting a reproducible test case to verify |
confirmed the work for this is done in #8113 Scheduled to release in version |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
When running tests locally through
cypress open
, and when interrupting tests by saving files (forcing a re-run), any failures occurred during the run can trigger this message:The error is not really originating from the application; it's occurring within
hookFailed
atcypress/packages/driver/src/cypress/runner.js
Line 526 in 4cfcae2
getTest()
andgetTestFromHookOrFindTest(hook)
end up returningundefined
.I've seen this on two very different projects.
Desired behavior:
The test fails with the normal readable stack trace.
Test code to reproduce
This is easily reproducible on this project (created a branch with a failing spec):
https://github.com/primitiveconcept/ludumdare46/tree/cypress/err-of-undefined/client
npm run cy:dev
for server + Cypressfilesystem.spec.ts
specfilesystem.spec.ts
while the test is running. Reproduces around 25% of the time, may require a few tries.If needed, I can try to come up with a minimal reproduction, but this isn't a very complex project. The server isn't required for the tests.
Versions
Cypress versions: Can reproduce on 4.9.0. Cannot reproduce on 4.5.0. Other versions are unstable for various reasons on the example project. At work, this started occurring on 4.6.0.
OS: MacOS + Windows
Browser: Chrome + Electron
The text was updated successfully, but these errors were encountered: