diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 5e981034e0..054446bf58 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -814,7 +814,9 @@ function serializeElementNode( const len = n.attributes.length; for (let i = 0; i < len; i++) { const attr = n.attributes[i]; - if (!ignoreAttribute(tagName, attr.name, attr.value)) { + // Looks like `attr.name` can be undefined although the types say differently + // see: https://github.com/getsentry/sentry-javascript/issues/10292 + if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) { attributes[attr.name] = transformAttribute( doc, tagName,