Title: JS bug
Last modified: June 25, 2018

---

# JS bug

 *  [Willy Bahuaud](https://wordpress.org/support/users/willybahuaud/)
 * (@willybahuaud)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/js-bug-6/)
 * Hello,
 * there is an error into the theme.js file : you try to define if `wp` var is false
   without testing if `wp` var exist (lines 576 and 678). If `wp` is undefined, 
   it will break javascript execution.
 * I suggest you to replace by: `if (typeof wp == 'undefined' || !wp || !wp.customize){`
 * Thank you

The topic ‘JS bug’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/mesmerize/1.6.180/screenshot.jpg)
 * Mesmerize
 * [Support Threads](https://wordpress.org/support/theme/mesmerize/)
 * [Active Topics](https://wordpress.org/support/theme/mesmerize/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/mesmerize/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/mesmerize/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Willy Bahuaud](https://wordpress.org/support/users/willybahuaud/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/js-bug-6/)
 * Status: not resolved