Uncaught TypeError – On Front-Page (when only one blog entry)

Home Forums Auberge Uncaught TypeError – On Front-Page (when only one blog entry)

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #19217

    katw
    Participant

    Uncaught TypeError – On Front-Page (when only one blog entry)

    Resolved

    Hi,

    Just thought you may like to know the theme (v2.4) is throwing a Javascript error on the home page if you have only one post (ie not enough data for masonry layout).

    Error is:

    Uncaught TypeError: $postsContainers.imagesLoaded is not a function

    at:

    • scripts-global.js line 221
    • scripts-global.js line 539
    #19218

    Oliver Juhas
    Keymaster

    Hi Kat,

    Thank you for spotting. That’s actually very weird as that code is being triggered only if Masonry JavaScript library has been loaded, and that library has a dependency for imagesLoaded library then. So, both should load and not throw any issue. And I can actually see they are loaded correctly on your website.

    Anyway, I will investigate what’s going on and fix the issue in next theme update. Thanks again for spotting, good catch :)

    Best regards,

    Oliver Juhas
    WebMan Design

    #19372

    katw
    Participant

    Any progress on a solution please?

    #19375

    Oliver Juhas
    Keymaster

    Hi katw,

    Please note that I can not replicate your issue.

    I have checked your web page source and I’ve noticed something different in loading the ImagesLoaded script:

    // Your website script loads with:
    <script type='text/javascript' async="async" src='/wp-includes/js/imagesloaded.min.js?ver=3.2.0'></script>
    
    // My website example:
    <script type='text/javascript' src='/wp-content/cache/busting/9/auberge/wp-includes/js/imagesloaded.min-3.2.0.js'></script>

    As you can see your website has added async="async" parameter and also the URL of the script is a bit different.

    Looking at the async="async" it uses double quotes instead of single ones which would be default WordPress. This brings me to conclusion that the async parameter was added manually or via a plugin. Could you please check your website setup and make sure not to load that particular script asynchronously please? Maybe some of your plugins do this – try to disable all the plugins except Jetpack to see if that helps?

    Best regards,

    Oliver Juhas
    WebMan Design

    #19386

    katw
    Participant

    Hi Oliver,

    I am struggling to find the source for the Async parameter. It isn’t on many scripts so it can’t be an optimiser plugin (it would attach the option to more).

    Will keep looking, I have deactivated the usual suspects but no luck yet.

    Will be in touch.

    #19387

    Oliver Juhas
    Keymaster

    Hi katw,

    Sure, this can be difficult to trace. I suggest disabling all the plugins to see if that helps. Also, don’t forget to disable/flush any server cache if you are using such solution (for example Siteground hosting has such cache enabled by default if I’m not mistaken). You can also contact your hosting provider and ask them if they can help.

    Best regards,

    Oliver Juhas
    WebMan Design

    #19391

    katw
    Participant

    Oliver,

    The cause was a benign plugin “Intense shortcodes” which is also using ImagesLoaded function to fix a bug in qtip.

    Would never have guessed it, was a real trial to isolate.

    I have lodged a support ticket but can confirm when this plugin is off the “Async” attribute is not added.

    #19392

    Oliver Juhas
    Keymaster

    Hi katw,

    Great job tracing the issue! Indeed, some plugins can do weird things ;) Async scripts loading is a good feature but it should be used responsibly with regards to other scripts.

    My additional question would be, does this solve your issue please?

    Best regards,

    Oliver Juhas
    WebMan Design

    #19407

    katw
    Participant

    The Intense plugin developer will be doing a fix in next release so any future clients of Auberge and Intense will no longer feel the pain you and I went through.

    This error is resolved.

    #19411

    Oliver Juhas
    Keymaster

    Hi katw,

    Thank you for sharing the information.

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.