Cannot read properties of undefined (reading 'isServer')
See original GitHub issueCurrent behavior
Since upgrading to Cypress 10, we are getting crashes in our CI with the following error:
Cannot read properties of undefined (reading 'isServer')
TypeError: Cannot read properties of undefined (reading 'isServer')
at TLSWrap.onerror (node:_tls_wrap:411:27)
cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +49ms
cypress:network:agent got family { family: 4, href: 'https://api.cypress.io/exceptions' } +0ms
cypress:server:browsers killing browser process +9s
cypress:server:browsers:chrome closing remote interface client +9s
cypress:server:browsers:chrome closing chrome +0ms
cypress:cli child event fired { event: 'exit', code: 1, signal: null } +2m
cypress:cli Stopping Xvfb +2m
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 https://github.com/nodejs/node/issues/41501 and PR https://github.com/nodejs/node/pull/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 https://github.com/nodejs/node/issues/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
Issue Analytics
- State:
- Created a year ago
- Reactions:14
- Comments:33 (7 by maintainers)
Top GitHub Comments
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.
I am having a similar issue. For me, It occurs when upgrading from
9.6.1
->9.7.0 (electron 100)
. For my test suite, I can consistently reproduce this issue locally on my mac and in aws codebuild CI docker image - both of which use nodev16.14.0
. I am not parallelizing tests. What is interesting is that it always fails on the 2nd test in my test suite (the first test passes successfully), but it isn’t specific to the actual 2nd test spec. I can move test specs around, comment/delete specs, and it still consistently fails on the 2nd spec that runs.