react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

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

Open puneetmakkar opened this issue 2 years ago • 13 comments

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

puneetmakkar avatar Oct 20 '23 02:10 puneetmakkar

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.

gabrieljablonski avatar Oct 20 '23 13:10 gabrieljablonski

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 !

puneetmakkar avatar Oct 21 '23 04:10 puneetmakkar

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

DriesVS avatar Jan 23 '24 18:01 DriesVS

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

alberthuynh91 avatar Feb 08 '24 17:02 alberthuynh91

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 avatar Feb 09 '24 11:02 gabrieljablonski

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

https://github.com/vuejs/vue-cli/issues/7431#issuecomment-1821173102

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.

gabrieljablonski avatar Feb 09 '24 11:02 gabrieljablonski

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.

mdv27 avatar Apr 02 '24 19:04 mdv27

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

danielbarion avatar May 20 '24 13:05 danielbarion

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);
  }
};

Fosol avatar May 31 '24 19:05 Fosol