Skip to content

ResizeObserver loop completed with undelivered notifications. #4812

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

Closed
webToLiu opened this issue Apr 10, 2023 · 5 comments
Closed

ResizeObserver loop completed with undelivered notifications. #4812

webToLiu opened this issue Apr 10, 2023 · 5 comments

Comments

@webToLiu
Copy link

webToLiu commented Apr 10, 2023

Bug report

Webpack-dev-server version 4.12.0 causes compile errors in application on browser viewport resize.

Actual Behavior

We run an application which uses webpack-dev-server 4.12.0 as a dependency. With this version of webpack-dev-server, whenever we resize the browser viewport in our application (e.g. by opening developer tools), an error overlay pops up stating "ResizeObserver loop completed with undelivered notifications.". This behaviour does not occur in the exact same version of the application that uses webpack-dev-server version 4.11.1.
image

Expected Behavior

The error should not appear when resizing the browser viewport in any way.

How Do We Reproduce?

1、Run an application that uses webpack-dev-server version 4.12.0;
2、Open developer tools in the browser.

Please paste the results of npx webpack-cli info here, and mention other relevant information

image

@alexander-akait
Copy link
Member

Sorry, we can't fix it here, it is a bug on your side, please read #4771

@alexander-akait
Copy link
Member

alexander-akait commented Apr 10, 2023

You can look at our source code and we don't use ResizeObserver, it means some package doesn't implement ResizeObserver correctly

@waytothevenus
Copy link

I've fixed like this.

`import { ResizeObserver } from '@juggle/resize-observer';

const ro = new ResizeObserver((entries, observer) => {
// Changing the body size inside of the observer
// will cause a resize loop and the next observation will be skipped
document.body.style.width = '50%';
});

// Listen for errors
window.addEventListener('error', e => console.log(e.message));

// Observe the body
ro.observe(document.body);`

@WBetancur
Copy link

I'm encountering an issue that only occurs on iOS devices (iPhone, iPad). The error seems to be coming from webpack, but I'm not explicitly using ResizeObserver. I suspect the issue might be related to one of the technologies I'm using (Bootstrap, Tabulator, Vue.js), but I'm struggling to pinpoint the exact source of the error. Could you help me with this problem, considering my context and the technologies involved?

@brendanahart
Copy link

@WBetancur I've encountered the same issue only on iOS devices. I created a hook in my react application to use in the component where is error was occurring (petyosi/react-virtuoso#1049 (comment)) and that suppressed the error but webpack still raised runtime errors.

Putting this in my webpack build config at the top level fixed everything:

devServer:{
    client: {
        overlay: {
            errors: true,       // Show critical errors
            warnings: false,    // Suppress warnings
            runtimeErrors: false, // Suppress runtime errors like ResizeObserver errors
        },
    },
}

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

No branches or pull requests

5 participants