question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Element.remove() is unsupported in Internet Explorer

See original GitHub issue

While testing 8.0-beta in IE11 I’ve run into a problem in unmountComponent() calling .remove() on base:

https://github.com/developit/preact/blob/8/src/vdom/component.js#L266

Changing that line to:

base.parentNode.removeChild(base);

…fixes the problem. I’m not sure if 8.0 is supposed to support IE, but worth keeping in mind.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
NekRcommented, Apr 6, 2017

I’m pretty sure IE8 never was supported by Preact. React does support it though.

3reactions
KrofDrakulacommented, Apr 6, 2017

If anyone’s trying to work around this problem, you can apply a minimum polyfill for the required methods:

(function() {
  function remove() { this.parentNode && this.parentNode.removeChild(this); }
  if (!Element.prototype.remove) Element.prototype.remove = remove;
  if (Text && !Text.prototype.remove) Text.prototype.remove = remove;
})();
Read more comments on GitHub >

github_iconTop Results From Across the Web

remove() not working in Internet Explorer - Stack Overflow
remove is not supported by ie. You would have to get the parent and call removeChild var node = document.getElementsByClassName('info')[i]; ...
Read more >
Element.remove() - Web APIs - MDN Web Docs
Element.remove() is unscopable. The remove() method is not scoped into the with statement. See Symbol.unscopables for more information.
Read more >
Fix site display issues with Compatibility View in Internet ...
You can turn it off by removing the site from your compatibility list. Not all website display problems are caused by browser incompatibility....
Read more >
"remove" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end ... DOM node method to remove the node itself from the...
Read more >
internet explorer remove element from dom - Tips &Tricks
To use the functionality of childNode.remove() API on internet explorer, you have to use the following polyfill: ( arr => { arr.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found