-
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 'isServer') #22291
Comments
Hey @fragglebob. Thank you for opening an issue. Have you found a way to reproduce this locally in a reproduction repo or does this only happen in CI with parallel jobs? Not ideal, but I am wondering if you can verify if this works by creating a custom image similar to this and bumping the node version to 16.15.1, and building a browser image to consume and run your tests in CI. |
Unfortunately I've not seen it locally or anyone else. I had already tried that suggestion of a custom images with v16.15.1 and the same browsers. I think the version being used by cypress's server is the version bundled in electron. I can see this from a couple of logs that report the node version. However it does start sub processes on the system version. Is there a way to skip the whole electron start up? I see electron v20 will have node v16.15.0, but it's still in alpha. We have some verbose logging on, and I've been trying to see if there is some pattern to when this happens, but not found anything yet. |
I am having a similar issue. For me, It occurs when upgrading from
|
You are right about this. The method I proposed won't work 😞 .
I don't think so. Even in run mode, the electron app still starts and runs a few shared processes. @flotwig @tbiethman do you all have any ideas on this one? It almost seems like we would need to wait until electron releases v20 to update the bundled node version. |
I'm having the same issue:
This is a (fairly) minimal reproducible example: https://github.com/devhid/cypress-v10-issue In my case, I'm trying to run Lighthouse on some sample websites for both mobile and desktop viewports, but I get the mentioned error at the end of the test run. My Lighthouse tests run fine on Cypress
But not on Cypress
I'm using the following Node / NPM versions:
Steps:
|
I have been able to reproduce the error in the repo @devhid has shared locally. It's doesn't happen every time for me, but it happens often enough. |
I started Cypress electron app directly with an debugger attached and have some extra info on the underlying error, that node is struggling to handle.
|
Ok, I've done some more research into this error. It seems the This is happening because the http/s Agent is reusing an existing socket, and this internal change the owner, so when an error does happen it breaks. The only way I can think to avoid a state in these node versions is to not use |
@fragglebob I'm not surprised to find out it's "something wacky to do with Keep-Alive", the interplay of Keep-Alive and Agents is a really tricky area. Sounds like the solution is to bump Cypress's internal Node.js version. Looks like Electron 19.0.0 has Node 16.14.2, so it should avoid this. Would still be nice to have a cleaner reproduction, but at least we have @devhid's sorta flaky repro to test if Electron 19 seems to resolve the issue.
Yeah, removing Keep-Alive would really hinder proxy performance. |
@flotwig yep, all that async stuff is complicated. Yep, a bump to Electron 19 should be good. Which is nicer than having to wait for version 20. I kinda came up a little script based on some unit tests in node, where I could quickly see what was going on in the |
I have the same behaviour locally and on ci : cypress version : "9.7.0" |
I have the same issue on 10.1.0 Is there anything I can do to fix this or do we just have to wait? |
same issue here after migrating to v10
|
We had to downgrade to cypress 9.6.1 (which also caused a chain of other downgrades which is very inconvenient). Hopefully this isn't too long in getting fixed or we will need a more involved workaround to prevent this in our CI. |
Hi everyone, anyway to circumvent this instead of downgrading to cypress to 9.6.1 ? |
we are releasing |
@AtofStryker you are right, the same issue on |
We are discussing as a team to figure out prioritizing an Electron |
Has there been any solution for this error? The same thing happens to me in github actions |
Just experienced this with 10.3 on macOS 12.4. |
Facing the same issue on:
|
Just experienced this with 10.3 |
experiencing with cypress 10.3, any workaround? This breaks github pipeline! |
Our workaround was the re-run the workflow a couple of times and then it worked. We are on Node v16 and npm v8 if for some reason those affect Cypress' ability to run. |
We are using node 16 and npm 8, running only a few scripts seems to work, but if I execute the entire suite, it always breaks. Is it suggestable to downgrade the cypress version? |
I rolled back to version 9 pretty much after constantly running into this on every suite run. Until cypress is based a newer version of electron. This is just gonna keep happening. |
That's interesting to hear. My team ran into the reported issue once, but haven't had any issues since while using the latest version. Not sure why there is a discrepancy between users. |
I guess it comes down to this being caused by network level errors and the way they are handled. There must be something in my setup that errors often enough to crash each test suite run. |
Good news. Upgraded today to 10.4.0. All seems resolved so far. 10.4 included the update to electron, which doesn't include a version of node where this is an issue anymore. |
@fragglebob awesome! Can any others also confirm that |
Resolved for me after upgrading to 10.4.0 :) |
I am going to close this since it should be resolved with the electron bump in #22775 which was released in |
@HugoBicudo el problema debería resolver en la versión más mejor o igual que |
This issue has resurfaced in version 12. I am still investigating |
Current behavior
Since upgrading to Cypress 10, we are getting crashes in our CI with the following error:
This is happening almost ever run we do. Hover we are running in 30 machines parallel, and the most I've seen is two machines fail in the same test run.
I found an issue nodejs/node#41501 and PR nodejs/node#41523 that relate to this error above, which seems to have been fixed in Node v16.15.0.
I set up for our tests to run in a custom container image today that is using Node v16.15.1, so I could see if that helps. However I've now realised that cypress has an internal version of node which is being used, v16.13.2 which still has this bug in it from Node.
Desired behavior
Ideal if should not being crashing when this error happens.
As this is an issue with how node is happening an error internally, there is probably some other error happening, but it's breaking before we can see what that is.
Test code to reproduce
Not sure how to reproduce this as I can't work out what is causing the issue.
In nodejs/node#41501 they weren't able to workout what the exact cause was, other than something wrong with the network somewhere.
Cypress Version
10.1.0
Other
No response
The text was updated successfully, but these errors were encountered: