Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

javascript - Cannot read property 'removeAttribute' of null: Cant find source of it

Im getting errors over and over again on each of my sites:

VM42958:5 Uncaught TypeError: Cannot read property 'removeAttribute' of null
(anonymous function) @ VM42958:5
(anonymous function) @ VM42958:20

Unfortunately i cant find the source of this error. If i open the related JavaScript lines i find the following:

VM42958

(function()
{
  var style = document.getElementById("9mr7n8lmeyjxk84i17g5ws714i") ||
              document.documentElement.shadowRoot.getElementById("9mr7n8lmeyjxk84i17g5ws714i");
  style.removeAttribute("id");
  Object.defineProperty(style, "disabled", {value: false, enumerable: true});
  Object.defineProperty(style.sheet, "disabled", {value: false, enumerable: true});
  var deleteRule = CSSStyleSheet.prototype.deleteRule;
  CSSStyleSheet.prototype.deleteRule = function(index)
  {
    if (this != style.sheet)
      deleteRule.call(this, index);
  }
  var removeRule = CSSStyleSheet.prototype.removeRule;
  CSSStyleSheet.prototype.removeRule = function(index)
  {
    if (this != style.sheet)
      removeRule.call(this, index);
  }
})();

This is not my code and i have no idea where it is comming from or where it is used. As libraries im using bootstrap, jQuery and Chart.js.

Does somebody know this part of code or is there a way to find the source of this error. i mean directly the line where it is appearing?

The same error occurs in this jsFiddle for example: jsFiddle

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Same problem here. For some reason Chrome ADBlock (not plus) was the cause.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...