Skip to content

Commit

Permalink
Swallow 'ResizeObserver error does not have an err object' error in c…
Browse files Browse the repository at this point in the history
…anvas
  • Loading branch information
chandlerprall committed Apr 17, 2020
1 parent c92a75d commit bca5d51
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions x-pack/legacy/plugins/canvas/public/lib/window_error_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ window.canvasInitErrorHandler = () => {
window.onerror = (...args) => {
const [message, , , , err] = args;

const isKnownError = Object.keys(knownErrors).find(errorName => {
return err.constructor.name === errorName || message.indexOf(errorName) >= 0;
});
// ResizeObserver error does not have an `err` object
// It is thrown during workpad loading due to layout thrashing
// https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded
// https://github.com/elastic/eui/issues/3346
const isKnownError =
message === 'ResizeObserver loop limit exceeded' ||
Object.keys(knownErrors).find(errorName => {
return err.constructor.name === errorName || message.indexOf(errorName) >= 0;
});
if (isKnownError) {
return;
}
Expand Down

0 comments on commit bca5d51

Please sign in to comment.