Title: Javascript error, not working
Last modified: August 24, 2016

---

# Javascript error, not working

 *  Resolved [clarklab](https://wordpress.org/support/users/clarklab/)
 * (@clarklab)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-not-working/)
 * Trying the plugin for the first time, I’m getting the error:
 * `Uncaught TypeError: Cannot read property 'firstChild' of undefined`
 * when I click on an image. No modal launches, just that console error. That’s 
   on top of the fact that the mosaic doesn’t work. The images just show up in a
   regular vertical stack.
 * [https://wordpress.org/plugins/photoswipe-masonry/](https://wordpress.org/plugins/photoswipe-masonry/)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/javascript-error-not-working/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/javascript-error-not-working/page/2/?output_format=md)

 *  [MatteoChiti](https://wordpress.org/support/users/matteochiti/)
 * (@matteochiti)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140013)
 * I have the same problem! There is a solution?
 * Thanks!
 *  [MatteoChiti](https://wordpress.org/support/users/matteochiti/)
 * (@matteochiti)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140015)
 * clarklab if I disabled SEO by Yoast plugin the gallery work perfectly!
 *  [johanthomasbrolin](https://wordpress.org/support/users/johanthomasbrolin/)
 * (@johanthomasbrolin)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140021)
 * Thanks MatteoChiti I had the same problem and your solution worked like a charm!
   The question is what in Yoasts SEO plugin was causing the error..
 *  [MatteoChiti](https://wordpress.org/support/users/matteochiti/)
 * (@matteochiti)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140022)
 * Yes… Now I try to open a topic on Yoast plugin support and hear what they say…
 *  [johanthomasbrolin](https://wordpress.org/support/users/johanthomasbrolin/)
 * (@johanthomasbrolin)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140026)
 * Ok nice, please let me know if you come up with a solution!! 🙂 Thanks man
 *  Plugin Author [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * (@deanoakley)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140031)
 * I can’t seem to replicate this. Please let me know what combination of theme,
   Yoast, and my plugin can give you this error. Thanks!
 *  [Trey Kane](https://wordpress.org/support/users/treykane/)
 * (@treykane)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140076)
 * I’m having the same issues. As soon as I installed Yoast, everything broke. I
   haven’t yet pinpointed why Yoast broke the Gallery. But, at this point… Yoast
   is more important than the Gallery.
 * I really liked the functionality of this plugin and I would use it again if this
   issue can be resolved.
 * Custom theme based on Underscores. Everything was working fine, until I installed
   Yoast. If I remove Yoast, it works again.
 *  [Karen](https://wordpress.org/support/users/karendelakaren/)
 * (@karendelakaren)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140077)
 * I also have the same problem. The website (with a custom theme) has a gallery
   on the homepage, which works, and it has one on a page, which doesn’t work and
   gives the same errors as described above. When I remove the gallery on the homepage,
   the one on the page starts working again. While I have Yoast plugins installed,
   none of them are activated.
 *  Plugin Author [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * (@deanoakley)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140078)
 * If someone can email me a theme with the problem I’ll try to track down the issue.
   
   [dean@thriveweb.com.au](https://wordpress.org/support/topic/javascript-error-not-working/dean@thriveweb.com.au?output_format=md)
 *  [MatteoChiti](https://wordpress.org/support/users/matteochiti/)
 * (@matteochiti)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140079)
 * Hi and thanks for the support!
 * The site where I have the bug is [http://www.gestofailtuo.it](http://www.gestofailtuo.it)
   
   The WordPress theme is completely made by me from an underscore naked theme…
 * In this moment I’m using another SEO plugin…
 *  [fredoclavier](https://wordpress.org/support/users/fredoclavier/)
 * (@fredoclavier)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140082)
 * Hi !
    I have the same problem : When I activate wordpress seo, Photoswipe Masonry
   Gallery becomes inactive. This is a post with photoswipe on my site : [Regarde où tu marches](http://www.regardeoutumarches.net/2015/05/22/regarde-ou-tu-marches-le-film/)(
   SEO by Yoast is deactivate for the moment) Any suggestion ? Thanks for the support!
 *  Plugin Author [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * (@deanoakley)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140086)
 * I just tried the “underscore naked theme” and no JS error for me. I’m keen to
   track it down if someone can send me a theme with the issue. [dean@thriveweb.com.au](https://wordpress.org/support/topic/javascript-error-not-working/dean@thriveweb.com.au?output_format=md)
 *  [fredoclavier](https://wordpress.org/support/users/fredoclavier/)
 * (@fredoclavier)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140087)
 * My site ([regardeoutumarches](http://www.regardeoutumarches.net/)) use this theme:
   [Fukasawa](https://wordpress.org/themes/fukasawa/)
    Thank you.
 *  Plugin Author [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * (@deanoakley)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140089)
 * The Fukasawa theme has it’s own grid layout which is probably the issue.
 *  [joelnewcomer](https://wordpress.org/support/users/joelnewcomer/)
 * (@joelnewcomer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/javascript-error-not-working/#post-6140090)
 * To all those having this conflict with Yoast SEO, I have a partial solution that
   allows you to have Yoast SEO and Photoswipe Masonry Gallery play nicely. Apparently
   there is an issue with how Yoast SEO adds Twitter card meta data. Disabling the
   Twitter card meta data fixes this issue. Go to SEO -> Social and click on the
   Twitter tab. Then uncheck the box next to “Add Twitter card meta data.” Photoswipe
   Masonry Gallery will go back to working beautifully.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/javascript-error-not-working/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/javascript-error-not-working/page/2/?output_format=md)

The topic ‘Javascript error, not working’ is closed to new replies.

 * ![](https://ps.w.org/photoswipe-masonry/assets/icon-128x128.png?rev=3464802)
 * [Photoswipe Masonry Gallery](https://wordpress.org/plugins/photoswipe-masonry/)
 * [Support Threads](https://wordpress.org/support/plugin/photoswipe-masonry/)
 * [Active Topics](https://wordpress.org/support/plugin/photoswipe-masonry/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photoswipe-masonry/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photoswipe-masonry/reviews/)

 * 16 replies
 * 8 participants
 * Last reply from: [THRIVE – Web Design Gold Coast](https://wordpress.org/support/users/deanoakley/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/javascript-error-not-working/page/2/#post-6140091)
 * Status: resolved