-
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 read properties of undefined (reading 'cookies') #26498
Comments
Same issue with Cypress 12.9.0, Node: 18.13.0, Windows 10.0.19044, Built-in Electron. |
I'll ask my colleagues to keep an eye out for when it happens to them and hopefully they can record a video or something of it happening, hopefully from that can divine the cause and some repro steps a little better. |
@jordanpowell88 Following the code - this is likely coming from here where we are parsing the cookies from the response... It would be interesting to understand typically when this error is hit since, to better account for what might be going on to see this error, but we likely need a safe-guard here as well to ensure the response is defined. |
We see this error occasionally when running our component tests in CI (Jenkins).
|
That certainly looks like the LOC @emilyrohrbough . Is anyone able to provide a reproducible example? |
See the same issue popup intermittently in our component tests as @albinohrn mentioned. It happens in the
The test itself is barely doing anything
|
@blessanm86 Do you have a |
@warrensplayer No I don't. It's just a bunch of commands and interceptors.
|
@warrensplayer We have the same issue and we do have a global beforeEach that sets some fixture data. |
@warrensplayer So I tried enabling cypress logs and take a dump. Here is a link to the gist. I hope this can shed some light |
I just experienced this issue as well. I'm also not doing anything with sessions or cookies. I restarted Cypress and the error disappeared. |
For folks who experience this pretty consistently, if you change your e2e config to us I'm also curious if there is a publicly-accessible URL I could test with, feel free to email me at [email protected] if you are able to share something privately |
This happens with us in gitlab ci as well, curiously it's always one particular test that runs into this error. This is the image we are using to test: Edit: we are not using any beforeeach. |
@MDanialSaleem I'm curious with the
This must be frustrating. Any more details about what that specific test might be doing that others are not? |
We don't yet have e2e tests with cypress yet so I can't enable testIsolation. These are component tests (we're migrating over from jest, one of the prime reasons was the flakiness of jsdom based tests so it's kinda funny that's this is happening lol). To answer your second question, no, all tests are pretty much the same, nothing special about this one. I'll try and create a reproducable example without any of our proprietary code if this issue persists. And if we're able to figure out a workaround/root cause, I'll update here as well. |
Thanks! Even the information that this is a component test helps a lot as it rules out a lot of things. |
After debugging a little bit, I think I have found at least where this is triggered, even if not the underlying cause: If So for when this is picked up: it seems like Stacktrace from forcing this to happen on
|
Note: routed this to both E2E and CT teams, since it affects both. |
Hey team! Please add your planning poker estimate with Zenhub @astone123 @dkasper-was-taken @jordanpowell88 @lmiller1990 @marktnoonan @mike-plummer |
I'm estimating based on a path forward where we add a check for |
I am estimating this based on the fact there is no reliable, minimal reproduction, meaning it will be hard to both debug, fix and test with confidence we are fixing the actual, underlying bug. |
Estimating based on adding the check |
I am facing this issue too, at the moment. For me, this issue occurs every time after I opened the URL from our Website in the Cypress GUI and closed it again. |
Can you provide a minimal reproduction @AlessandroCaggiano ? Is it consistent? |
It's a consistent error |
Can you share some random test? Or, ideally, a minimal reproduction - if you can share a repository we can clone and use to reproduce the error consistently, that would make fixing this a whole lot easier. Right now it's hard to be confident in any patch since we cannot consistently reproduce the error, but it sounds like you are able to do so. |
Sorry, I can't share this repository. |
In my case I got this error due to this code cy.window().then(win => {
cy.stub(win, 'open').as('windowOpen');
}); called before the page actually loads after the |
Still running into this issue. Has anyone implemented a fix or found a solution? |
Hi all, is there anybody on that? |
Hi All, Did someone already fixed this issue in some other PR or may be I can work on that? Please respond asap, thanks.. |
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. |
This issue has been closed due to inactivity. |
Current behavior
Not sure why, but every now and again multiple members of our team get the error above in the Cypress test window along with this stack trace:
looks like something in the cypress runner that clears session between tests is failing.
Desired behavior
No response
Test code to reproduce
it's inconsistent when it happens, so it's hard for me to make a clear repro. But here is our cypress config:
Cypress Version
12.9.0
Node version
16.16.0
Operating System
macOS 13.2.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: