Title: Uncaught ReferenceError
Last modified: June 21, 2017

---

# Uncaught ReferenceError

 *  [Johan Yourstone](https://wordpress.org/support/users/jyourstone/)
 * (@jyourstone)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-9/)
 * Hello,
 * I’ve been using Autoptimize for a while without any problems. But 1-2 weeks ago
   WooCommerce wouldn’t load product images anymore. In the shop layout the image
   appears, but when you view single products no image is shown.
    I get the following
   console error:
 *     ```
       JQMIGRATE: Migrate is installed, version 1.4.1
       autoptimize_697d517
       .php:36 Uncaught ReferenceError: items_in_cart is not defined
           at HTMLDocument.<anonymous> (autoptimize_697d517
       .php:36)
           at i (jquery.js?ver=1.12.4:2)
           at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
           at Function.ready (jquery.js?ver=1.12.4:2)
           at HTMLDocument.K (jquery.js?ver=1.12.4:2)
       ```
   
 * Enabling the try-catch setting “fixes” this issue, but where does that ReferenceError
   come from?

Viewing 2 replies - 16 through 17 (of 17 total)

[←](https://wordpress.org/support/topic/uncaught-referenceerror-9/?output_format=md)
[1](https://wordpress.org/support/topic/uncaught-referenceerror-9/?output_format=md)
2

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-9/page/2/#post-9608218)
 * well, I used Divi + AO CSS&JS optmization on the previous version of autoptimize.
   com without issues, so it’s not like it can’t work at all.
 * that being said, there’s [a very interesting problem with Divi+revslider breaking optimized CSS on Microsoft browsers](https://wordpress.org/support/topic/autoptimize-css-breaking-on-edge-w-revslider-plugin/page/2/#post-9606827)(
   IE11 & Edge), maybe that’s what you’re referring to as well?
 * frank
 *  Thread Starter [Johan Yourstone](https://wordpress.org/support/users/jyourstone/)
 * (@jyourstone)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-9/page/2/#post-9608798)
 * Well it works, but there are graphical issues since I use some custom CSS as 
   well. For instance, it will load the “original” site first and then apply the
   CSS after, which doesn’t look good. Plus some other glitches as well. I think
   that’s mostly because I use custom CSS though.
 * If I decide to get to the bottom of the JS error I’ll reply here though.

Viewing 2 replies - 16 through 17 (of 17 total)

[←](https://wordpress.org/support/topic/uncaught-referenceerror-9/?output_format=md)
[1](https://wordpress.org/support/topic/uncaught-referenceerror-9/?output_format=md)
2

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

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [Johan Yourstone](https://wordpress.org/support/users/jyourstone/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/uncaught-referenceerror-9/page/2/#post-9608798)
 * Status: not resolved