Support » Plugin: WooCommerce Blocks » JavaScript errors

  • Resolved mookie4a4

    (@mookie4a4)


    Since the update to 2.2 this plugin produces a few JS errors:
    Uncaught ReferenceError: _ is not defined
    (index):221 Uncaught ReferenceError: moment is not defined
    (index):221 Uncaught ReferenceError: wp is not defined
    (index):221 Uncaught ReferenceError: wp is not defined
    (index):221 Uncaught ReferenceError: wp is not defined
    (index):221 Uncaught ReferenceError: wp is not defined
    (index):221 Uncaught ReferenceError: wp is not defined
    (index):221 Uncaught ReferenceError: wp is not defined

    When using JS combine and load plugins like Autoptimize then all the product images fail to display due to the JS errors within the combined file.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Optimizing Matters

    (@optimizingmatters)

    you can try adding js/dist to Autoptimize’s comma-separated JS optimization exclusion list mookie404, but do take into account that this probably implies that woocommerce blocks is adding a ton of JS for front-end rendering and doing so will have a significant impact (with and without AO).

    hope this helps,
    frank (ao dev)

    mookie4a4

    (@mookie4a4)

    Thanks for the tip! I’m not sure if I want to sacrifice my sites good page score just for this plugin. I’ll run some tests with this.

    Cheers!

    Plugin Author Albert Juhé Lluveras

    (@aljullu)

    Thanks for the report @mookie4a4! Was your error appearing in the front-end of your site or in wp-admin?

    Notice in a future version of WooCommerce Blocks it will only load scripts in the frontend when there is a block that requires them, so there shouldn’t be any impact in your site page score if you only use blocks that don’t require frontend scripts.

    Just the front-end, I rolled back to the previous version. What changed or was added to cause the sudden JS errors? There must be some JS conflicts or load issues because I couldn’t get your plugin to work with any of the most popular JS combine/optimise plugins.

    Hope that helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘JavaScript errors’ is closed to new replies.