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.

parent.getAttribute is not a function error

See original GitHub issue

After debugging this issue i have come to find that parent variable is being set to either Window or Document but neither of the two contain the getAttribute() function.

This issue breaks my code and prevents the render of the component. I have defined my LazyLoad component as so…

    <div className={'Section6')}>
      <LazyLoad height={333} offset={300} overflow once>
        <Picture
          image={sectionImage}
          imageRetina={sectionImageRetina}
          imageMobile={sectionImageMobile}
          imageMobileRetina={sectionImage}
          screen={SCREEN_SIZES.SCREEN_SM_MAX} />
      </LazyLoad>
    </div>

The parent div has a position: relative; styling

Have I not used the overflow prop correctly? because it seems that although the overflow prop os set, the returned object in parent doesn’t contain the function which needs to be checked for the condition and therefore breaks at this point and throws an error.

alt text

Have i missed something?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

1reaction
jasonslyviacommented, Feb 10, 2017

Can you please try 2.2.2?

0reactions
cnolimitcommented, Feb 14, 2017

hi @jasonslyvia and @yangg thanks for all your help, although since posting this issue i’ve changed the structure of the code and so i’m unable to check whether these solutions would work for me. but since refactoring I haven’t ran into any errors and found it works much better now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: abc.getAttribute is not a function - Stack Overflow
I get the error message: TypeError: abc.getAttribute is not a function . What have I done wrong? javascript · jquery.
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 >
Uncaught TypeError: a.getAttribute is not a function
When the code updating the component attribute is removed, there's no error, but the delete button does not function as desired. Changing splice ......
Read more >
Element.getAttribute() - Web APIs | MDN
The getAttribute() method of the Element interface returns the value of a specified attribute on the element.
Read more >
getAttribute is not a function : r/learnjavascript - Reddit
I am trying to get an array of attribute id's using: frameList = document. getElementsByTagName('iframe').
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