Title: Uncaught TypeError
Last modified: October 26, 2018

---

# Uncaught TypeError

 *  [Nathan Shower](https://wordpress.org/support/users/nshower/)
 * (@nshower)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/uncaught-typeerror-30/)
 * Hello,
 * Very nice little plugin. Makes implementing Masonry super simple.
 * We found that on our particular theme, we were experiencing the following error
   on pages that DIDN’T implement the masonry layout. It could be something non-
   standard we did when implementing, but we were able to fix it using the following:
 * Error:
 *     ```
       Uncaught TypeError: Cannot read property 'id' of null
           at AnimOnScroll._init (AnimOnScroll.js?ver=4.9.8:89)
           at new AnimOnScroll (AnimOnScroll.js?ver=4.9.8:75)
           at main.js?ver=4.9.8:1
       ```
   
 * Solution:
 * Wrap
 * `if ( document.getElementById( 'sm-grid-layout' ) ) {}`
 * around the main.js file to check for the existence of sm-grid-layout before trying
   to implement it.
 * Thanks!

The topic ‘Uncaught TypeError’ is closed to new replies.

 * ![](https://ps.w.org/simple-masonry-layout/assets/icon-128x128.png?rev=1500465)
 * [Simple Masonry Layout](https://wordpress.org/plugins/simple-masonry-layout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-masonry-layout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-masonry-layout/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-masonry-layout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-masonry-layout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-masonry-layout/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Nathan Shower](https://wordpress.org/support/users/nshower/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/uncaught-typeerror-30/)
 * Status: not resolved