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

ResizeObserver Error only occurs when using webpage in Cypress #20341

Open
lmiller1990 opened this issue Feb 23, 2022 · 2 comments
Open

ResizeObserver Error only occurs when using webpage in Cypress #20341

lmiller1990 opened this issue Feb 23, 2022 · 2 comments
Labels
pkg/driver This is due to an issue in the packages/driver directory pkg/runner This is due to an issue in the packages/runner directory Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: unexpected behavior User expected result, but got another

Comments

@lmiller1990
Copy link
Contributor

lmiller1990 commented Feb 23, 2022

Current behavior

Some components (for CT) and websites (for E2E) throw a ResizeObserver error when visited/mounted in Cypress' AUT, but not when accessed regularly. This seems to be a Chrome specific issue. Sometimes, this causes my test to fail when running in Cypress.

This now-closed PR contains more info about the error and some discussion.

Desired behavior

Do not error in Cypress.

Test code to reproduce

https://github.com/lmiller1990/resize-observer-error

See README.md for details. This is an example using Cypress 9.x. Same error in CT and E2E.

Cypress Version

9.x, probably older

Other

Google "ResizeObserver Cypress", this issue has been around for a long time, at least since 4.x.

@lmiller1990 lmiller1990 added pkg/driver This is due to an issue in the packages/driver directory pkg/runner This is due to an issue in the packages/runner directory labels Feb 23, 2022
@jennifer-shehane jennifer-shehane added the type: unexpected behavior User expected result, but got another label Feb 23, 2022
@iomedico-beyer
Copy link

I use this workaround for now, but is there any way to silence the message completely (until investigated/resolved)? It kind of polutes the output/videos.

@codaDevDan
Copy link

codaDevDan commented May 12, 2023

I get this only when using electron in run mode (cypress run). Many of the threads on this topic suggest some variation of this workaround:

Cypress.on('uncaught:exception', err => !err.message.includes('ResizeObserver loop limit exceeded')).

They do not seem to have any effect. To be clear, this error never happens in 'open' mode or when using our webapp. It also does not happen when using cypress run -b chrome, in which case the tests pass.

@nagash77 nagash77 added CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. labels May 15, 2023
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Apr 3, 2024
This commit addresses false negative failures in Cypress due to a known
Chrome issue.

The included change prevents Cypress tests from failing because of the
non-critical `ResizeObserver loop limit exceeded` error, which occurs
inconsistently during CI/CD runs with GitHub runners. This error has
been documented in CHrome and does not affect actual browser usage or
local test runs. This commit implements a widely recommended workaround
that ignores this specific error during test execution.

Error from Cypress:

```
Error: The following error originated from your application code, not from Cypress.
> ResizeObserver loop limit exceeded
```

The solution follows community-driven advice and past discussions on
handling this benign exception within test scenarios. It contributes to
more reliable CI/CD results by filtering out irrelevant error noise.

For detailed background and discussion on this error, see:

- Cypress issues: cypress-io/cypress#8418, cypress-io/cypress#20341
- Cypress PRs: cypress-io/cypress#20257, cypress-io/cypress#20284
- Discussion in Quasar: quasarframework/quasar#2233
- Discussion in specification repository: WICG/resize-observer#38
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue Apr 4, 2024
This commit addresses false negative failures in Cypress due to a known
Chrome issue.

The included change prevents Cypress tests from failing because of the
non-critical `ResizeObserver loop limit exceeded` error, which occurs
inconsistently during CI/CD runs with GitHub runners. This error has
been documented in CHrome and does not affect actual browser usage or
local test runs. This commit implements a widely recommended workaround
that ignores this specific error during test execution.

Error from Cypress:

```
Error: The following error originated from your application code, not from Cypress.
> ResizeObserver loop limit exceeded
```

The solution follows community-driven advice and past discussions on
handling this benign exception within test scenarios. It contributes to
more reliable CI/CD results by filtering out irrelevant error noise.

For detailed background and discussion on this error, see:

- Cypress issues: cypress-io/cypress#8418, cypress-io/cypress#20341
- Cypress PRs: cypress-io/cypress#20257, cypress-io/cypress#20284
- Discussion in Quasar: quasarframework/quasar#2233
- Discussion in specification repository: WICG/resize-observer#38
@jennifer-shehane jennifer-shehane removed the CT Issue related to component testing label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory pkg/runner This is due to an issue in the packages/runner directory Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

5 participants