Cannot convert undefined or null to object
We got this error in Sentry:
Here's the minified code that seems to crash:
function _e(e, t) {
let n,
r,
o,
a = e.mirror,
i = e.stylesheetManager,
s = null;
s = '#document' === t.nodeName ? a.getId(t) : a.getId(t.host);
const c =
'#document' === t.nodeName
? null === (n = t.defaultView) || void 0 === n
? void 0
: n.Document
: null ===
(o = null === (r = t.ownerDocument) || void 0 === r ? void 0 : r.defaultView) ||
void 0 === o
? void 0
: o.ShadowRoot,
u = Object.getOwnPropertyDescriptor(null == c ? void 0 : c.prototype, 'adoptedStyleSheets'); // <--- `getOwnPropertyDescriptor` is line 1:43134
return null !== s && -1 !== s && c && u
? (Object.defineProperty(t, 'adoptedStyleSheets', {
configurable: u.configurable,
enumerable: u.enumerable,
get: function () {
let e;
return null === (e = u.get) || void 0 === e ? void 0 : e.call(this);
},
set: function (e) {
let t,
n = null === (t = u.set) || void 0 === t ? void 0 : t.call(this, e);
if (null !== s && -1 !== s)
try {
i.adoptStyleSheets(e, s);
} catch (e) {}
return n;
}
}),
Le(function () {
Object.defineProperty(t, 'adoptedStyleSheets', {
configurable: u.configurable,
enumerable: u.enumerable,
get: u.get,
set: u.set
});
}))
: function () {};
}
Hey Mathias...
Can you open this as a support ticket in app as we'll need to ask details about your site specifically which you might not want to share publicly? :)
We'll need a link to the session or sessions and whether the page is public for us to visit and investigate?
Does the sentry issue suggest it's a particular browser that's having the issue?
https://us.posthog.com/#panel=support%3Asupport%3Asession_replay%3Alow
Thanks!
Hey Mathias...
Can you open this as a support ticket in app as we'll need to ask details about your site specifically which you might not want to share publicly? :)
We'll need a link to the session or sessions and whether the page is public for us to visit and investigate?
Does the sentry issue suggest it's a particular browser that's having the issue?
us.posthog.com/#panel=support%3Asupport%3Asession_replay%3Alow
Thanks!
I opened a support ticket.
More info:
- Browser: Chrome 122.0.0
- OS: Windows >= 10
- Runtime: Browser
closing this since a support ticket was opened