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

Random ChunkLoadError in E2E tests #30521

Open
papatelst opened this issue Nov 1, 2024 · 4 comments
Open

Random ChunkLoadError in E2E tests #30521

papatelst opened this issue Nov 1, 2024 · 4 comments
Labels
E2E Issue related to end-to-end testing stage: needs information Not enough info to reproduce the issue type: bug

Comments

@papatelst
Copy link

papatelst commented Nov 1, 2024

Current behavior

We are getting following random error on Teamcity Docker cypress base image based E2E test runs. Initially it was mostly during after each hook execution, however now we are seeing it even outside of after each hook. It happens randomly in random specs. We have been seeing this error since upgrade to cypress version 13.5.1

The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.
              
 Loading chunk 59 failed.
(timeout: https://env.companyname.com/scripts/build/desktop/59.9dcc63fc.bundle.js)

When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
              
This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
              
https://on.cypress.io/uncaught-exception-from-application
              
Because this error occurred during a `after each` hook we are skipping all of the remaining tests.

image

Another example of chunkloaderror happening outside of aftereach hook
image

I was told to open a separate issue for End-to-End testing as mentioned in existing bug here.

Desired behavior

NO random chunkload errors.

Test code to reproduce

Not related to specific test or code.

Cypress Version

13.5.1

Node version

20.9.0

Operating System

linux

Debug Logs

No response

Other

No response

@jennifer-shehane jennifer-shehane added E2E Issue related to end-to-end testing type: bug labels Nov 4, 2024
@jennifer-shehane
Copy link
Member

@papatelst Are you able to provide a project that reproduces this behavior? We haven't seen this with e2e tests before

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 4, 2024
@papatelst
Copy link
Author

@jennifer-shehane It happens in our cypress framework with random tests in random test runs. Hence cannot provide a concrete example for this.

@papatelst
Copy link
Author

papatelst commented Nov 6, 2024

@jennifer-shehane noticed same error today, this time in Loading CSS chunk in *.bundle.css file as seen in snapshot below. The snapshot above in main bug description was for *.bundle.js file.
image

Can we suppress this error globally in our Cypress\Support\index.js file using following code:
Cypress.on("uncaught:exception", (err, runnable, promise) => { // we expect a random error like //"ChunkLoadError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection." // and don't want to fail the test so we return false if (err.message.includes("ChunkLoadError") && promise) { return false; } });

@papatelst
Copy link
Author

@AtofStryker Can you answer my question above about "Can we suppress this error globally" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing stage: needs information Not enough info to reproduce the issue type: bug
Projects
None yet
Development

No branches or pull requests

2 participants