Skip to content

Commit

Permalink
fix: Ignore errors in style observers (#16)
Browse files Browse the repository at this point in the history
We keep getting errors from the stylesheet observer callback. So let's
try catch these to be safe.
  • Loading branch information
mydea authored Jan 23, 2023
1 parent cda9277 commit ac67b09
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,12 @@ export function initObservers(
viewportResizeHandler();
inputHandler();
mediaInteractionHandler();
styleSheetObserver();
styleDeclarationObserver();
try {
styleSheetObserver();
styleDeclarationObserver();
} catch(e) {
// ignore errors in style observers
}
fontObserver();
pluginHandlers.forEach((h) => h());
};
Expand Down

0 comments on commit ac67b09

Please sign in to comment.