Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert undefined or null to object #1091

Open
MathiasWP opened this issue Mar 20, 2024 · 2 comments
Open

Cannot convert undefined or null to object #1091

MathiasWP opened this issue Mar 20, 2024 · 2 comments

Comments

@MathiasWP
Copy link

We got this error in Sentry:

image

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 () {};
	}
@pauldambra
Copy link
Member

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!

@MathiasWP
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants