Closed
Description
openedon Dec 27, 2019
When WooCommerce is active, Jetpack adds the following inline JS regardless of whether lazyload is enabled or not:
jQuery( 'body' ).bind( 'wc_fragments_refreshed', function() { jQuery( 'body' ).trigger( 'jetpack-lazy-images-load' ); } );
It's inline script, so if jQuery is deferred (done normally for performance reasons), this causes a jQuery is not defined error.
Source: https://github.com/Automattic/jetpack/blob/master/3rd-party/woocommerce.php#L105
I assume two things have to change:
- Check if Lazyload is even enabled.
- Ensure jQuery exists by executing on window.onload event. Or have it in a normal JS file with jQuery dependency rather than inline JS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment