Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Conversation

@cyjake
Copy link
Contributor

@cyjake cyjake commented Aug 16, 2020

If any changes are incurred during the callback, then layout happens again, but here, the system finds the shallowest at which depth a change occurred (measured in simple node depth from the root). Any changes that are related to something deeper down in the tree are delivered at once, while any that are not are queued up and delivered in the next frame, and an error message will be sent to the Web Inspector console: (ResizeObserver loop completed with undelivered notifications).
https://webkit.org/blog/9997/resizeobserver-in-webkit/

the observed target might be removed during react re-render, which then triggers ResizeObserver loop limit exceeded or ResizeObserver loop completed with undelivered notifications error

One way to re-produce this issue is to visit pages with table and tooltip, such as https://yuque.com/dashboard/docs, hover the cursor onto the column header with sorter then an error about ResizeObserver loop limit is raised.

@codecov
Copy link

codecov bot commented Aug 16, 2020

Codecov Report

Merging #72 into master will increase coverage by 6.47%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
+ Coverage   91.93%   98.41%   +6.47%     
==========================================
  Files           3        3              
  Lines         124      126       +2     
  Branches       27       28       +1     
==========================================
+ Hits          114      124      +10     
+ Misses         10        2       -8     
Impacted Files Coverage Δ
src/util.ts 96.55% <100.00%> (+29.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7da201e...1fbacb8. Read the comment docs.

@cyjake cyjake force-pushed the fix-resize-observer-undelivered branch from 05c1309 to 1fbacb8 Compare August 16, 2020 13:27
@afc163
Copy link
Member

afc163 commented Aug 17, 2020

什么场合会出现这个问题呢?

@afc163
Copy link
Member

afc163 commented Aug 17, 2020

image

我的 chrome 没重现出来。

@cyjake
Copy link
Contributor Author

cyjake commented Aug 17, 2020

还蛮常见的…… observe 了两个有嵌套关系的元素的时候就会出现

语雀这个没有在控制台报是因为语雀监听了 window.onerror 做了自动上报,可以看 network 里的 /api/logs/error

@cyjake
Copy link
Contributor Author

cyjake commented Aug 17, 2020

image

).toBeFalsy();
expect(
isSamePoint(null, { pageX: 0, pageY: 2, clientX: 3, clientY: 4 }),
).toBeFalsy();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed by eslint --fix

@afc163
Copy link
Member

afc163 commented Aug 17, 2020

@afc163
Copy link
Member

afc163 commented Aug 17, 2020

ant-design/ant-design#23246

@zombieJ 来看看。

@cyjake
Copy link
Contributor Author

cyjake commented Aug 17, 2020

噢,语雀的 window.onerror 注册在 react 代码执行之前,所以先被我们拦截了

@zombieJ zombieJ merged commit 50b4961 into react-component:master Aug 17, 2020
@zombieJ
Copy link
Member

zombieJ commented Aug 17, 2020

+ rc-align@4.0.2

@sherly-tkpd
Copy link

sherly-tkpd commented Nov 5, 2020

in what version is this included @afc163 ? because I'm using the latest (4.8.0) and this error still happens with Table scroll.
4.8.0 is still using rc-align 4.0.1

antd 4.8.0
├─┬ rc-cascader 1.4.0
│ └─┬ rc-trigger 5.0.9
│ └── rc-align 4.0.1
├─┬ rc-dropdown 3.2.0
│ └─┬ rc-trigger 5.0.9
│ └── rc-align 4.0.1

@zombieJ
Copy link
Member

zombieJ commented Nov 6, 2020

@sherly-tkpd remove lock file and re-install.

@nigulasikk
Copy link

nigulasikk commented Aug 3, 2021

in what version is this included @afc163 ? because I'm using the latest (4.8.0) and this error still happens with Table scroll.
4.8.0 is still using rc-align 4.0.1

antd 4.8.0
├─┬ rc-cascader 1.4.0
│ └─┬ rc-trigger 5.0.9
│ └── rc-align 4.0.1
├─┬ rc-dropdown 3.2.0
│ └─┬ rc-trigger 5.0.9
│ └── rc-align 4.0.1

I am using antd (4.16.9) and "ResizeObserver loop limit exceeded" still happend when i set "scroll" attribute in Table.
https://codesandbox.io/s/4ovng?file=/src/index.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants