question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read properties of undefined (reading 'isServer')

See original GitHub issue

Current 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:closed
  • Created a year ago
  • Reactions:14
  • Comments:33 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
fragglebobcommented, Aug 4, 2022

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.

7reactions
darrinmn9commented, Jun 14, 2022

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 node v16.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.

TypeError: Cannot read properties of undefined (reading 'isServer')
    at TLSWrap.onerror (node:_tls_wrap:411:27)
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve (reading 'isServer') error in npm?
Catch this error after npm i. Version npm - 8.0.0, nodejs - 16.11.0. npm ERR! Cannot read properties of undefined ...
Read more >
error Cannot read properties of undefined (reading 'isServer')
I am setting up JSS (NextJS) application following https://miguelminoldo.fr/2021/10/18/deploying-sitecore-jss-next-vercel/.
Read more >
cannot read properties of undefined (reading 'map') nodejs
My Error in my console reads - TypeError: Cannot read properties of undefined (reading 'map'). I cannot figure out why the cached data...
Read more >
npm err! cannot read properties of undefined ... - Code Grepper
npm ERR! Cannot read properties of undefined (reading 'isServer') //if you have the error above just turn off any of your virtual servers....
Read more >
Kibana 17.1 restarting after: "TypeError: Cannot read ...
TypeError : Cannot read properties of undefined (reading 'isServer') at TLSWrap.onerror (node:_tls_wrap:411:27). Upgrading to 7.17.1, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found