Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/session-replay-browser/src/session-replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,10 @@ export class SessionReplay implements AmplitudeSessionReplay {
errorHandler: (error: unknown) => {
const typedError = error as Error & { _external_?: boolean };

// styled-components relies on this error being thrown and bubbled up, rrweb is otherwise suppressing it
if (typedError.message.includes('insertRule') && typedError.message.includes('CSSStyleSheet')) {
// CSS-in-JS libraries such as styled-components and stitches rely on this error being thrown and
// bubbled up, rrweb is otherwise suppressing it. The goal is to rethrow errors from
// `CSSStyleSheet.insertRule` and `CSSGroupingRule.insertRule`.
if (typedError.stack?.includes('insertRule')) {
throw typedError;
}

Expand Down