cypress: TypeError: Cannot destructure property 'data' of 'undefined' as it is undefined. at :4649:286986
Current behavior
I have this error in test
1) Dashboard
should render:
TypeError: Cannot destructure property 'data' of 'undefined' as it is undefined.
at <embedded>:4649:286986
This path at <embedded>:4649:286986 does not make sense
Desired behavior
Cypress should report correct error path
Test code to reproduce
I cannot consistently reproduce it. It happens randomly
Cypress Version
12.8.1
Node version
18.15.0
Operating System
Linux
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 8
- Comments: 52 (14 by maintainers)
Same here. Starts failing after update to v12. Only on component testing
Since our cypress v12 update we’re experiencing the same exception. I can share some additional stuff:
npx nx affected --target=component-testornpx nx run-many --target=component-test --allto run the tests@lmiller1990 We turned of parallelization due to the issue - but it didn’t help.
Hi,
We are also experiencing this issue. We’re using Angular
14.3.0and Cypress2.7.0and node16.19.1. The issue only occurs on Jenkins Linux, while we couldn’t reproduce it on a Windows machine locally. It only happens with component tests and on the first run. The problem started after upgrading from angular 13 to angular 14This issue is causing a lot of problems for us, as a large number of our builds are failing because of it. We would really appreciate any help in resolving this issue as soon as possible.
Here are our dependencies:
@lmiller1990 I tried removing the code coverage plugin. The pipeline still fails.
I’ve spent a bit of time looking at this and have not been able to reproduce this issue which makes it very difficult to track down exactly what is going wrong. I will make some changes to the specific line of code that’s blowing up so we get a more meaningful error, but that won’t address the underlying issue (simply change how it’s reported in the logs). If anyone can supply a reproduction case that would be extremely helpful since this appears to be a combination of CI configuration, resourcing, and component testing project structure/size that is difficult to replicate without a starting point.
There are a few things that I can suggest pending a reproduction being provided:
@lmiller1990 Yes, we have this problem with component, never with e2e. We are using Angular 14.3.0 and angular uses webpack 5.76. The tests continue, but the result of the first one is a fail. If we disable the first one, the problem will be the same with the next first one., so this is not linked to the test.
I think that will be hard to reproduce, because we have two projects using the same version of the dependencies, has some test in a common repository (executed on the both projects). One is crashing 50% of the time, and the second one, never crash. The big difference between the two projects, is that the problematic one is more big and take more time to compile and load.
Note also that happens only on jenkins (linux), and never in local (windows).
Following the list of our dependencies.
Hello
Same problem for me on Jenkins. In attachment the DEBUG log.
https://raw.githubusercontent.com/vapkse/logs/main/debug-cypress-component-issue.log
Yeah I had the same
"before each" hook for "should render"and I don’t have “before each” hook in my test But we use@cypress/code-coverageand it adds before each hook automatically. I removed this plugin from code but error still happens. It is reported without “before each” hook now