sentry-javascript: TypeError null is not an object (evaluating 'elt.parentNode')

I have started getting some error reports in Sentry from our JS app which look like this:

TypeError null is not an object (evaluating 'elt.parentNode')

Problem is, that nowhere in our own source code, nor in our vendor source code, can I find a single instance of elt.parentNode in the code.

Also, Sentry seems to have a hard time reporting the source of the error as well:

TypeError: null is not an object (evaluating 'elt.parentNode')
  at ? (/shop/kleding/new-arrivals/fresh/donkerblauw:1:350)

This doesn’t actually point to any JS code, just the rendered HTML of our SPA. And in the breadcrumbs, it just gets repeated several times:

image

In short, I have no idea where this error is coming from, and I am suspecting it might be generated by Sentry itself somehow, as I can’t find any references to it in our own code.

Any suggestions on how to analyse this further and/or rule out Sentry/ravenjs as the source of this issue?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 44 (6 by maintainers)

Commits related to this issue

Most upvoted comments

So, getsentry/sentry#4823 is now merged, which means that as soon as it deploys (within hours), you can enable the “Filter out errors known to be caused by browser extensions” inbound filter to filter/suppress this error. It will not count towards your quota.

You can find this at: Project → Project Settings → Inbound Filters

image

Seems to be related to zoom in/out in the GSA. Whenever I zoom in/out my website, this event triggered.

Sorry to bother you, but I’m seeing the exact same issues since I’ve installed Prebid.js on my website. I caught errors in a dedicated script, but I can’t figure out what is causing this. Do you have more info in your Sentry’s log? The error only occurs on iOS devices, AFAIK. Including iPhones, so the 3rd-party extension doesn’t seems to be the issue here.

I am also trying to find what causes this. We have some stats on our website that shows this started happening on October 25th, the day after Apple and Safari got updates:

https://support.apple.com/en-ca/HT201222

It also happens exclusively on Safari on IOS on our side, according to the requests User-Agent

I have been receiving a lot of these same error reports as well (I do not use Sentry).

  • They started by at least Oct 28 (maybe a little earlier, some of my earlier reports have already been deleted)
  • The error is being received from iOS 8, 9, and 10
  • The error ONLY occurs on Safari 600.1.4
  • The error ONLY occurs for users agents that contain “GSA/20.3.136880903”
  • The error occurs well after my page has finished loading, but I don’t know what triggers it
  • The error is occurring for less 1% of my iOS visitors, but IP addresses that report the error tend to report it again in later sessions

This leads me to believe Safari 600.1.4 introduced a change that broke someone’s browser extension (GSA?). I plan to filter the error and ignore it.

Why not

Raven.config('https://<key>@sentry.io/<project>', {
  ignoreErrors: [ "null is not an object (evaluating 'elt.parentNode')" ]
}).install();

Intuitively I would expect ignoring at this level should prevent the event being sent, while ignoring from the Sentry dashboard would stop it from cluttering the UI but still count towards the quota?

I got the same issue also on iOS/Safari with an Angular application. No way to track this down.

shouldSendCallback should help you.

Raven.config('https://<key>@sentry.io/<project>', {
  shouldSendCallback: function (data) {
    // do something with data.exception
  }
}).install();

We’re hitting our quota in Sentry due to so many of these events. Is there a way to filter this event? Ignoring the event still counts toward the quota.

Chiming in as I see the same problem on prod sites + have some supplemental info + this thread is the #1 result on Google.

  • We only see this with Safari 600.1.4 (iOS 8?).
  • We managed to get the call stack but it’s not very helpful: {/hereisourpageurl/:1:351 global code@/hereisourpageurl/:1:1238}.
  • Our HTML doesn’t have JS in the first few lines so these numbers don’t make sense in that context.
  • We’re not using Santry and mostly using established JS libs like jQuery – nothing bleeding edge. Our code doesn’t have elt.parentNode anywhere, not in the libraries we use either.
  • We do use New Relic that is known to inject JS in the code and it does have e.parentNode, but it does not inject it to the first line and e.parentNode is around column 12000 so it’s probably not the culprit.

I’d wager this is an iOS 8 Safari specific issue, for some code that’s written in JS and injected into the HTML. Could be someone using iOS Safari behind some corporate firewall that injects JS that is not compatible with iOS8?

Yeah, I’m just debating how to put this in our filters.

e.g. do we add Google Search app as a “legacy browser”, giving you the ability to reject all errors from that browser?

Or do I add an entry for "(evaluting elt.parentNode)" in our 3rd-party extensions filter?

I’m leaning towards the latter: this is not a 3rd-party extension per-say, but it’s probably more in line with what people expect from that filter (throw out errors that don’t belong to them).

i was getting the same error for drag drop library, it was specific for safari 14 version, i think its variable type issue, code which was used by library was DD.dropLoad = null; to resolve the issue i have changed to DD.dropLoad = new Object();

this has resolved my problem, i hope this helps someone else as well.

I’m getting multiple null is not an object (evaluating 'element.tagName') errors in my project. The code I’ve written doesn’t reference any of element.tagName at all(lib codes might). Maybe it could be related to this issue and I could just ignore it, I guess?

I am getting the same error for IPads TypeError null is not an object (evaluating ‘elt.parentNode’) I am using Sentry and in the details it shows: Remote file took too long to load: (15s, https://www.*********.com/******_form.php?opt=MA==) Collapse { "url": "https://www.**********.com/*******_form.php?opt=MA==", "timeout": 15 } screenshot