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.

SVGSVGElement is missing method node.getAttribute

See original GitHub issue

Running the following code with LitElement

html`<svg viewport="0 0 1 1"></svg>`

Results in the following error:

 TypeError: Cannot read property 'split' of null

      40 |                         var attributeValue = node.getAttribute(attributeLookupName);
      41 |                         node.removeAttribute(attributeLookupName);
    > 42 |                         var statics = attributeValue.split(exports.markerRegex);
         |                                                      ^
      43 |               { type: 'attribute', index: index, name: name_1, strings: statics });
      44 |                         partIndex += statics.length - 1;

SVGElement should extend Element but extends HTMLElement. Is that why?

Link to inheritence chain for SVGSVGElement:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

capricorn86commented, Dec 10, 2020

Thank you for reporting @Atyn!

I will look into it as soon as possible 🙂

Atyncommented, Feb 5, 2021

@capricorn86 That sounds good! It was fixed when upgrading so it is no longer a problem 👍. Thanks! 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Read Attributes of SVG-Elements in HTML via JS
This way i can retrieve the Attributes via getAttribute() consistently in all browsers. Share.
Read more >
SVGSVGElement - Web APIs | MDN
Chrome Edge SVGSVGElement Full support. Chrome1. Toggle history Full support. Edge12. Toggle hist... animationsPaused Full support. Chrome1. Toggle history Full support. Edge79. Toggle hist... checkEnclosure Full...
Read more >
SVGSVGElement | typescript - v3.7.7 - Microsoft Open Source
Interface SVGSVGElement. Provides access to the properties ... node is a CDATASection node. ... Occurs when the play method is requested. param. The...
Read more >
SVGSVGElement | Aspose.SVG for .NET API Reference
Methods ; HasAttributeNS(string, string), Returns true when an attribute with a given local name and namespace URI is specified on this element or...
Read more >
TypeError: getAttribute is not a function in JavaScript
To solve the "getAttribute is not a function" error, make sure to call the `getAttribute()` method on a valid DOM element and place...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found