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 loop completed with undelivered notifications #1283

Closed
thomfoolery opened this issue Oct 19, 2023 · 9 comments
Closed

ResizeObserver loop completed with undelivered notifications #1283

thomfoolery opened this issue Oct 19, 2023 · 9 comments

Comments

@thomfoolery
Copy link

Describe the issue

We're receiving quite a lot of error's from bugsnag reporting the below error.

ResizeObserver loop completed with undelivered notifications

Our investigations of the impacted pages turned up the only usage of ResizeObserver to be in @codemirror/view.

We are on the latest version v6.21.3

I'm posting this to see if others have encountered this error,
and if there is a way to catch or silence the error.

Browser and platform

Error reports seem to be just coming from chrome

Reproduction link

No response

@mtalebian
Copy link

mtalebian commented Oct 23, 2023

Hi,
I also experienced this error when switching focus from an HTML input to the CodeMirror component.

marijnh added a commit to codemirror/view that referenced this issue Oct 24, 2023
@marijnh
Copy link
Member

marijnh commented Oct 24, 2023

I haven't found a way to reproduce this, so I cannot confirm the fix, but I think attached patch, which removes the only resize observer that immediately causes an action, is likely to fix this issue.

@mtalebian
Copy link

mtalebian commented Oct 24, 2023

I solved my problem. For me, this problem happened because of installing an extension in Chrome. When I removed the extension, the problem was solved.

If you want to reproduce this error, install the Sider.ai extension in chrome and in your React 18 project add Html input
and CodeMirror component. when switching focus from HTML input to the CodeMirror component a black warning page with following message appears:

Uncaught runtime errors:
ERROR
ResizeObserver loop completed with undelivered notifications.
at handleError (https://localhost:3000/static/js/bundle.js:94032:58)
at https://localhost:3000/static/js/bundle.js:94051:7

Thanks for your attention.

@marijnh
Copy link
Member

marijnh commented Oct 24, 2023

Thanks for getting back on that. I'd say that is misbehavior on the part of the extension, and not something CodeMirror is really responsible for, but regardless, I expect the current version of the library will avoid the problem.

@marijnh marijnh closed this as completed Oct 24, 2023
@thomfoolery
Copy link
Author

I think attached patch, which removes the only resize observer that immediately causes an action, is likely to fix this issue.

@marijnh Thank you for your response, was there a recent patch update?
We were on latest at the time I wrote the issue AFAIK.

@marijnh
Copy link
Member

marijnh commented Oct 25, 2023

Yes, @codemirror/view 6.21.4 has this patch.

@thomfoolery
Copy link
Author

@marijnh I'm still investigating,
but my preliminary findings are that upgrading to this patch (from 6.21.3) breaks our syntax highlighting using classHighlighter from @lezer/highlight.

I'll see if I can find some time to reproduce it stackblitz.

@marijnh
Copy link
Member

marijnh commented Oct 25, 2023

Older versions of npm duplicate packages when you upgrade a single package. Remove your package lock and reinstall all dependencies.

And upgrade npm. Or, if you're using yarn, which is broken in a similar way, I'd recommend you dump that and switch to a recent npm.

@thomfoolery
Copy link
Author

@marijnh Thank you for your help with this,

We've updated to @codemirror/view v6.21.4 but we're still getting ResizeObserver loop completed with undelivered notifications in bugsnag. The only usage of ResizeObserver on these pages reporting this error are from this file.

We haven't been able to replicate this error either and I'm not sure if this is the result of a memory leak on our end,
but I just wanted to share our findings incase you had additional context to share.

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

3 participants