• Seems quite a common issue after Googling, but here’s my issue anyway.

    I only have Minify turned on, and is set to auto.
    When JS settings is set to default (blocking), the RoyalSlider on the homepage works fine.

    However, any other setting (non-blocking by JS, async or defer) will cause the slider to just show a black space, along with the dreaded console error: Uncaught ReferenceError: jQuery is not defined

    In the footer where the JS file is, directly below it is the initiation script for the slider, so it seems that somewhere in the minified JS File, the jQuery call is being knocked out.

    <script type="text/javascript" src="https://www.origin-psychics.com/wp-content/cache/minify/2fb2f.js"></script>
    
    <script id="new-royalslider-init-code" type="text/javascript">
    jQuery(document).ready(function($) {
    	$('.new-royalslider-1').royalSlider({template:'default',image_generation:{lazyLoading:!0,imageWidth:'',imageHeight:'',thumbImageWidth:'',thumbImageHeight:''},thumbs:{thumbWidth:96,thumbHeight:72},autoPlay:{enabled:!0,delay:5000,stopAtAction:!1},block:{moveOffset:20,speed:400,delay:200},width:'100%',height:'',autoScaleSlider:!0,autoScaleSliderWidth:4,autoScaleSliderHeight:1,slidesSpacing:0,imageScaleMode:'fill',imageScalePadding:0,transitionType:'fade',transitionSpeed:1000,loop:!0,randomizeSlides:!0});
    });
    </script>

    Site in question is https://www.origin-psychics.com – Is there anything I can do here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ramanan

    (@superpoincare)

    Yeah this is because of dependency issues caused by async/defer.

    What you can do is externalize this javascript in another file (or ask the plugin developer to do so).

    You need to load JQuery in the header in order to solve this problem so remove it from the footer and set it to the head and make sure its set to blocking (not async, defer, or anything else).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Setting non-blocking minify JS causes RoyalSlider to break’ is closed to new replies.