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

[BUG] ResizeObserver loop completed with undelivered notifications - webpack-dev-server related #1104

Open
puneetmakkar opened this issue Oct 20, 2023 · 13 comments
Labels

Comments

@puneetmakkar
Copy link

After upgrading to 5.21.5 (from 4.2.21), I am getting this error locally sometimes when tooltip is opened.
Maybe its due to the usage of ReactObserver

react-scripts v5 brings in webpack-dev-server v4 which shows runtime errors on full screen.

Potential fix and more details can be seen here.

Reproduction
Happens sometimes when opening the react tooltip component

Expected behavior
Not getting the error.

Screenshots
Screenshot 2023-10-19 at 7 31 22 PM

OS: MacOS.
Browser: Chrome

@gabrieljablonski
Copy link
Member

gabrieljablonski commented Oct 20, 2023

Can you test this after disabling all of your browser extensions? Or try it on another browser.

Which solution from the StackOverflow question are you suggesting? The usage of requestAnimationFrame() doesn't seem like something I'd be comfortable adding right now.

I've also seen a suggestion to set the version for webpack-dev-server to v4.14.0. See it that helps.

@puneetmakkar
Copy link
Author

I guess [email protected] was to remove the overlay error due to cancelled api calls.
I was able to get rid of ResizeObserver overlay error with [email protected]
thanks !

@DriesVS
Copy link

DriesVS commented Jan 23, 2024

Strange, we still have the same issue with [email protected].

@alberthuynh91
Copy link

Running into this issue as well on react 16.13, react-tooltip 5.26, using webpack with craco

@gabrieljablonski
Copy link
Member

gabrieljablonski commented Feb 9, 2024

Although it seems like this is a "benign" error message (as in you can safely ignore it, shouldn't break anything on production app), it is still annoying to deal with it during development.

Should've been fixed on #1137, which is >=v5.25.1 (also see #1136 for context).

Will reopen until we can figure out why it's back.

@gabrieljablonski
Copy link
Member

gabrieljablonski commented Feb 9, 2024

Here's the webpack config on how to ignore the specific error (untested, let me know if it works)

vuejs/vue-cli#7431 (comment)

module.exports = {
  //...
  devServer: {
    client: {
      overlay: {
        runtimeErrors: (error) => {
          const ignoreErrors = [
            "ResizeObserver loop limit exceeded",
            "ResizeObserver loop completed with undelivered notifications.",
          ];
          return !ignoreErrors.includes(error.message);
        },
      },
    },
  },
};

Again, we're assuming this error can be safely ignored, since there hasn't been any evidence of it interfering with expected tooltip behavior.

Will still keep this open until we can figure out a permanent fix.

@mdv27
Copy link

mdv27 commented Apr 2, 2024

module.exports = {
  //...
  devServer: {
    client: {
      overlay: {
        runtimeErrors: (error) => {
          const ignoreErrors = [
            "ResizeObserver loop limit exceeded",
            "ResizeObserver loop completed with undelivered notifications.",
          ];
          return !ignoreErrors.includes(error.message);
        },
      },
    },
  },
};

This does not work for me.

@danielbarion
Copy link
Member

Hey guys, can you please provide a simple reproducible repository? I would like to take a look when I have some available time

@Fosol
Copy link

Fosol commented May 31, 2024

Only workaround I've found is

//Stop error resizeObserver
const debounce = (callback: (...args: any[]) => void, delay: number) => {
  let tid: any;
  return function (...args: any[]) {
    // eslint-disable-next-line no-restricted-globals
    const ctx = self;
    tid && clearTimeout(tid);
    tid = setTimeout(() => {
      callback.apply(ctx, args);
    }, delay);
  };
};

const _ = (window as any).ResizeObserver;
(window as any).ResizeObserver = class ResizeObserver extends _ {
  constructor(callback: (...args: any[]) => void) {
    callback = debounce(callback, 20);
    super(callback);
  }
};

Copy link

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

@github-actions github-actions bot added the Stale This has not seen activity in quite some time label Aug 30, 2024
@iphonic
Copy link

iphonic commented Sep 20, 2024

Still facing the same issue

@gabrieljablonski gabrieljablonski removed the Stale This has not seen activity in quite some time label Sep 20, 2024
@zehawki
Copy link

zehawki commented Oct 15, 2024

After upgrading to 5.28.0 from 4.2.21 just now, getting continuous ResizeObserver loop completed with undelivered notifications. after moving around on tooltip.

Chrome, React 17, CRA 5

@danielbarion
Copy link
Member

@zehawki can you please provide a reproducible example so I can take a detailed look into it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants