Support » Plugin: Autoptimize » ReferenceError

  • Resolved saowp

    (@saowp)


    I have been using Autoptimize for about a year with my WooCommerce+Storefront setup, it’s worked great so far. However, of late (maybe after some other plugin updates?) I started noticing some errors in the JavaScript console.

    ReferenceError: _ is not defined
    ReferenceError: moment is not defined
    ReferenceError: wp is not defined
    TypeError: o is undefined autoptimize_xxxxx.js:iii:jjjj

    Along with (because of?) these errors, the product image stopped displaying in the product page. The errors go away when I deactivate Autoptimize. Any idea what I can do to start using this awesome plugin again?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    other plugin updates for sure 🙂

    try adding wp-includes/js to the comma-separated JS opimization exclusion list maybe?

    That worked! You are awesome. This must be the quickest support I have received any place 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome saowp, feel free to leave a review of the plugin and support here! 🙂

    FWIW, I think the error is due to a lodash / underscore clash. I don’t know much about the matter but maybe the way your plugin combines different javascript files can be tweaked to accommodate this?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    nah, AO merely aggregates JS in the order found in the HTML, excluding what needs to be excluded based on config (inline JS on or off + exclusion field). not really different ways to combine there 🙂

    Ok. I just found it curious that the errors stopped when I deactivated AO but kept the other plugins active. I’d be glad to send you more details, if it helps you decipher the bug.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.