Skip to content
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

cy.wait on an array return TypeError Cannot read property 'split' of undefined line 136007:55 #28233

Closed
mykodimy opened this issue Nov 3, 2023 · 7 comments · Fixed by #28713

Comments

@mykodimy
Copy link

mykodimy commented Nov 3, 2023

Current behavior

Cypress version 13.4.0

cy.wait on an array return "TypeError: Cannot read property 'split' of undefined"
/__cypress/runner/cypress_runner.js:136007:55

Here is the example code:

cy.intercept('**/Submit').as('submit');
cy.intercept('**/GetDetails').as('getDetails');
cy.get('#saveBtn').click();
cy.wait(['@submit', '@getDetails']);
@mykodimy mykodimy changed the title cy.wait on an array return TypeError Cannot read property 'split' of undefined cy.wait on an array return TypeError Cannot read property 'split' of undefined line 136007:55 Nov 3, 2023
@jennifer-shehane
Copy link
Member

@mykodimy Could you provide an example we can run? There's likely something specific about your code or app that is necessary to see this error, since we have tests around waiting for standard requests in an array.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 3, 2023
@mykodimy
Copy link
Author

mykodimy commented Nov 4, 2023

I didn't have example as my app is an internal website. The same e2e code functions properly when I downgrade from Cypress 13.4.0 to Cypress 12.17.3. This issue only happen after I upgrade to Cypress 13.

Will the stack trace help?

Image

Image

at (https://abc.com/__cypress/runner/cypress_runner.js:136008:55)
at Array.sort ()
at (https://abc.com/__cypress/runner/cypress_runner.js:136005:14)
at (https://abc.com/__cypress/runner/cypress_runner.js:136018:9)
at tryCatcher (https://abc.com/__cypress/runner/cypress_runner.js:1807:23)
at Promise._settlePromiseFromHandler (https://abc.com/__cypress/runner/cypress_runner.js:1519:31)
at Promise._settlePromise (https://abc.com/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (https://abc.com/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (https://abc.com/__cypress/runner/cypress_runner.js:1701:18)
at Promise._fulfill (https://abc.com/__cypress/runner/cypress_runner.js:1645:18)
at PromiseArray._resolve (https://abc.com/__cypress/runner/cypress_runner.js:2932:19)
at MappingPromiseArray._promiseFulfilled (https://abc.com/__cypress/runner/cypress_runner.js:4987:18)
at Promise._settlePromise (https://abc.com/__cypress/runner/cypress_runner.js:1581:26)
at Promise._settlePromise0 (https://abc.com/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (https://abc.com/__cypress/runner/cypress_runner.js:1701:18)
at (https://abc.com/__cypress/runner/cypress_runner.js:2392:25)
From previous event:
at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (https://abc.com/__cypress/runner/cypress_runner.js:3486:19)
at Promise._then (https://abc.com/__cypress/runner/cypress_runner.js:1239:17)
at Promise.then (https://abc.com/__cypress/runner/cypress_runner.js:1132:17)
at CommandQueue.runCommand (https://abc.com/__cypress/runner/cypress_runner.js:144488:8)
at next (https://abc.com/__cypress/runner/cypress_runner.js:144688:19)
at (https://abc.com/__cypress/runner/cypress_runner.js:144709:16)
at tryCatcher (https://abc.com/__cypress/runner/cypress_runner.js:1807:23)
at Promise._settlePromiseFromHandler (https://abc.com/__cypress/runner/cypress_runner.js:1519:31)
at Promise._settlePromise (https://abc.com/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (https://abc.com/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (https://abc.com/__cypress/runner/cypress_runner.js:1701:18)
at Promise._fulfill (https://abc.com/__cypress/runner/cypress_runner.js:1645:18)
at Promise._resolveCallback (https://abc.com/__cypress/runner/cypress_runner.js:1439:57)
at Promise._settlePromiseFromHandler (https://abc.com/__cypress/runner/cypress_runner.js:1531:17)
at Promise._settlePromise (https://abc.com/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (https://abc.com/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (https://abc.com/__cypress/runner/cypress_runner.js:1701:18)
at Promise._fulfill (https://abc.com/__cypress/runner/cypress_runner.js:1645:18)
at Promise._resolveCallback (https://abc.com/__cypress/runner/cypress_runner.js:1439:57)
at Promise._settlePromiseFromHandler (https://abc.com/__cypress/runner/cypress_runner.js:1531:17)
at Promise._settlePromise (https://abc.com/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (https://abc.com/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (https://abc.com/__cypress/runner/cypress_runner.js:1701:18)
at Promise._fulfill (https://abc.com/__cypress/runner/cypress_runner.js:1645:18)
at Promise._resolveCallback (https://abc.com/__cypress/runner/cypress_runner.js:1439:57)
at Promise._settlePromiseFromHandler (https://abc.com/__cypress/runner/cypress_runner.js:1531:17)
at Promise._settlePromise (https://abc.com/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (https://abc.com/__cypress/runner/cypress_runner.js:1621:10)

@simongarciam
Copy link

simongarciam commented Nov 14, 2023

I am also running into the same issue
#28219

tried with 13.5.0 this morning and same errors 😢

https://cloud.cypress.io/projects/oy3esu/runs/8864/overview?roarHideRunsWithDiffGroupsAndTags=1

@samzurcher
Copy link

After upgrading from 13.2.0 to 13.6.2, we see the same issue:

  • The issue does not occur in 13.3.0, but is reproducible from 13.3.1 onwards.
  • In our tests, we wait for multiple requests to finish and therefore use a wait on an array.
  • The bug is triggered only in one test; I don't see an obvious difference between this test and the other tests.
  • The bug occurs every time I run that test; meaning it is reproducible.
  • Unfortunately, I cannot share code.

Hope you guys can identify the source of the bug since this prevents us from upgrading to the current version. Let me know in case I can be of assistance.

@dnzxy
Copy link

dnzxy commented Jan 12, 2024

I would suspect that this issue was added with #27806 as part of 13.1.1. Specifically this:

// sort responses based on browser request ID
const requestIdSuffixA = a.browserRequestId.split('.').length > 1 ? a.browserRequestId.split('.')[1] : a.browserRequestId
const requestIdSuffixB = b.browserRequestId.split('.').length > 1 ? b.browserRequestId.split('.')[1] : b.browserRequestId

We are running into similar issues when we updated from 12.12.0 to 13.6.0.

Can you give an update on a fix for this issue @jennifer-shehane @chrisbreiding @astone123? If a fix is imminent we will wait, otherwise we'll have to downgrade to 13.3.0.

@astone123
Copy link
Contributor

I wasn't actually able to reproduce this locally, but I added a null check that should fix this issue in #28713

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 17, 2024

Released in 13.6.3.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.6.3, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: needs information Not enough info to reproduce the issue label Jan 17, 2024
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants