cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.7k stars 3.16k forks source link

TypeError: Cannot destructure property 'data' of 'undefined' as it is undefined. at <embedded>:4649:286986 #26187

Open aleksandrlat opened 1 year ago

aleksandrlat commented 1 year ago

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

rizalishan commented 10 months ago

For me it was an interceptor which was having a null value and changing value to anything but null worked for me

ckpinguin commented 6 months ago

@rizalishan Same for me, I had intercepts too in commands.js. Not about the null values in my sight. When I moved them out as just normal support functions in separate js files, the errors were gone.