• Resolved davenoakes

    (@davenoakes)


    Hi,

    We’d overcome this problem before, but something seems to have changed and it’s happening again.

    While Optimize Javascript is enabled, the header images on our homepage aren’t loading.

    Here is a list of the errors that show in console

    JQMIGRATE: Migrate is installed, version 1.4.1
    autoptimize_511b8362d4c56a46fd828aa4fc77e547.js:441 Uncaught SyntaxError: Unexpected end of input
    q2w3-fixed-widget.min.js?ver=5.1.2:1 MutationObserver not supported or disabled!
    fbevents.js:25 [Facebook Pixel] – Duplicate Pixel ID: 2063988053837456.
    u @ fbevents.js:25
    A @ fbevents.js:25
    T @ fbevents.js:25
    ga @ fbevents.js:25
    ra @ fbevents.js:25
    (anonymous) @ fbevents.js:25
    (anonymous) @ fbevents.js:25
    v @ fbevents.js:25
    F @ fbevents.js:25
    l @ fbevents.js:25
    k.global.releaseConfig @ fbevents.js:25
    E @ fbevents.js:25
    plugin @ 2063988053837456?v=2.8.10&r=stable:25
    ta @ fbevents.js:25
    (anonymous) @ 2063988053837456?v=2.8.10&r=stable:24
    flatsome.js?ver=3.4.3:101 Uncaught TypeError: n.hoverIntent is not a function
    at HTMLLIElement.<anonymous> (flatsome.js?ver=3.4.3:101)
    at Function.each (jquery.js?ver=1.12.4:2)
    at a.fn.init.each (jquery.js?ver=1.12.4:2)
    at Object.attach (flatsome.js?ver=3.4.3:101)
    at Object.attach (flatsome.js?ver=3.4.3:62)
    at HTMLDocument.<anonymous> (flatsome.js?ver=3.4.3:1)
    at i (jquery.js?ver=1.12.4:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
    at Function.ready (jquery.js?ver=1.12.4:2)
    at HTMLDocument.K (jquery.js?ver=1.12.4:2)
    (anonymous) @ flatsome.js?ver=3.4.3:101
    each @ jquery.js?ver=1.12.4:2
    each @ jquery.js?ver=1.12.4:2
    attach @ flatsome.js?ver=3.4.3:101
    attach @ flatsome.js?ver=3.4.3:62
    (anonymous) @ flatsome.js?ver=3.4.3:1
    i @ jquery.js?ver=1.12.4:2
    fireWith @ jquery.js?ver=1.12.4:2
    ready @ jquery.js?ver=1.12.4:2
    K @ jquery.js?ver=1.12.4:2

    I currently have the following scripts excluded

    seal.js, js/jquery/jquery.js,wp-spamshield, jquery.js, jquery-migrate.min.js, jquery.rpp.js, jquery.rpp-isotope.js, EasyAzonPro, easyazon-pro, flatsome/assets, interactive-world-maps, q2w3_sidebar_options, q2w3, q2w3-sidebar, q2w3-sidebar-options

    Any ideas what else I can add to the exclude list so this problem goes away?

    Thanks in advance for your help!

    The page I need help with: [log in to see the link]

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

    (@optimizingmatters)

    wp-includes/js/hoverIntent.min.js will probably do it ??

    Thread Starter davenoakes

    (@davenoakes)

    Hi.

    Thanks very much. That has fixed it!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    for future reference, this was the relevant line in the JS error:

    
    flatsome.js?ver=3.4.3:101 Uncaught TypeError: n.hoverIntent is not a function

    after that it’s a question of looking at the HTML source of an un-optimized page (by adding ?ao_noptimize=1 to the URL) for something related to hoverIntent.

    might help if you have to troubleshoot in the future ??

    Thread Starter davenoakes

    (@davenoakes)

    Hi!

    Thanks for that advice. I wanted it to work out for me, but I’ve been searching through the source code and excluding things I thought might help, but I haven’t been able to.

    My issue today is that variable products in my shop are not working properly (when you select them, the price doesn’t change). When Optimize Javascript is disabled it works again.

    Example page https://southeastasiabackpacker.com/bookings/surf-school-bali-surf-tours/

    This is what appears in console…

    jquery-migrate.min.js?ver=1.4.1:2 JQMIGRATE: Migrate is installed, version 1.4.1
    autoptimize_a007450b1b22772c1c1aa58387a699c3.js:520 Uncaught SyntaxError: Unexpected end of input
    q2w3-fixed-widget.min.js?ver=5.1.3:1 MutationObserver not supported or disabled!
    (index):485 Uncaught ReferenceError: ulp_prepare_ids is not defined
    at HTMLDocument.<anonymous> ((index):485)
    at i (jquery.js?ver=1.12.4:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
    at Function.ready (jquery.js?ver=1.12.4:2)
    at HTMLDocument.K (jquery.js?ver=1.12.4:2)
    (anonymous) @ (index):485
    i @ jquery.js?ver=1.12.4:2
    fireWith @ jquery.js?ver=1.12.4:2
    ready @ jquery.js?ver=1.12.4:2
    K @ jquery.js?ver=1.12.4:2
    (index):1 [DOM] Found 2 elements with non-unique id #currency_converter: (More info: https://goo.gl/9p2vKq) <form method=?”post” id=?”currency_converter” action>?…?</form>? <form method=?”post” id=?”currency_converter” action>?…?</form>?
    Navigated to chrome-extension://cjabmdjcfcfdmffimndhafhblfmpjdpe/toolbar/placeholder.html

    I’ve gone into the source code and searched for MutationObserver, currency_converter,q2w3-fixed-widget.min.js, ulp_prepare_ids and anonymous and tried excluded various things, but nothing has worked yet.

    This is what I’ve tried adding to the exclude list

    wp-content/plugins/q2w3-fixed-widget, wp-content/cache/autoptimize/js/autoptimize_a007450b1b22772c1c1aa58387a699c3.js, wc_currency_converter, currency_converter, #currency_converter, wp-includes/js/jquery/jquery.js?ver=1.12.4:2

    None of that has worked. Any ideas? Please do include further recommendations on how to troubleshoot these issues when they come up. I much prefer resolving them myself. Unfortunately, this time I’ve not been able to…

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I think this JS error is the most important one;

    (index):485 Uncaught ReferenceError: ulp_prepare_ids is not defined

    for which you would have to exclude wp-content/plugins/layered-popups/js/script.min.js (found by looking for ulp_ in the JS debugger in Firefox developer tools).

    hope this helps,
    frank

    Thread Starter davenoakes

    (@davenoakes)

    I’m afraid this time that hasn’t solved the issue.

    These errrors are still appearing

    /wp-content/cache/autoptimize/js/autoptimize_48c75a1a444af9fbfabfdac3d00e3275.js:419 Uncaught SyntaxError: Unexpected end of input
    q2w3-fixed-widget.min.js?ver=5.1.3:1 MutationObserver not supported or disabled!
    (index):1 [DOM] Found 2 elements with non-unique id #currency_converter: (More info: https://goo.gl/9p2vKq) <form method=?”post” id=?”currency_converter” action>?…?</form>? <form method=?”post” id=?”currency_converter” action>?…?</form>?
    (index):1 Blink deferred a task in order to make scrolling smoother. Your timer and network tasks should take less than 50ms to run to avoid this. Please see https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/rail and https://crbug.com/574343#c40 for more information.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    the mutation-observer and “[DOM] 2 elements with” are unlikely to be the reason, both are there now as well, so that leaves us with the mysterious “Unexpected end of input” … afraid I’ll need to be able to see that error being produced to see what is going wrong. do you have a non-prod site where you could leave things in a broken state?

    frank

    Thread Starter davenoakes

    (@davenoakes)

    Hi,

    For some reason I never received an email telling me about this response. I’ve only just seen it.

    I’ve just asked my host to clone the site so I can send you a non-prod version of it.

    As soon as they’ve sorted that, I’ll get in touch with the URL for you.

    Thread Starter davenoakes

    (@davenoakes)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    1. re dev site; can you disable “try catch wrapping” in AO?
    2. re live site; those are automatically generated JS-files which are not there any more. additionally at that point you seemed to have disabled “serve as static files” (hence the .php suffix). when I look at your live site now, the AO’ed files load very fast (cfr. https://www.webpagetest.org/result/180207_5P_eb4efbfe5d5910b4482326e8859c5942/1/details/#waterfall_step1 request 2, 3 and 6).

    Thread Starter davenoakes

    (@davenoakes)

    Hi Frank,

    Thanks for your response. I have tried disabling try catch wrapping, and no luck. Same problem persists.

    On the live site I don’t know what’s going on. It was loading in 2 seconds a couple of weeks ago, now it’s taking 7!

    Thanks again for your help!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    for the dev-site: I’d be most interested to see what errors are visible on the browser console when try/catch wrapping is off, however I get a “We’re just doing a little bit of work on this page”-message so I can’t see what is happening.

    for the live site; well, you are pushing 8MB of data through and as you’re on HTTP/2 a lot of those resources (images) are pushed through simultaneously which seems to be hurting the “time to first byte” of even your static resources. but the main question is; what did you change between a couple of weeks ago & now?

    Thread Starter davenoakes

    (@davenoakes)

    I’ll take the dev site off maintanance mode. I was just worried about google indexing it and punishing us for duplicate content. But it’s just occured to me I should just no index the whole site and that will avoid any issues.

    As for the changes on the live site. I really don’t know what they could be. We tried using a facebook messanger plugin that seemed to slow things down a bit, but I deleted that hastily. The strangest thing is that before there were more images on the page, with a big slider loading 4 of the big ones at the top. It seems to be mainly the images that are causing the problem. I don’t know why that could be…

    Anyway, I’ll take maintanance mode of dev so you can see those errors.

    Thanks again!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, the error on Dev:

    ReferenceError: Flatsome is not defined

    This is because the Autoptimized file contains JS that refers to an object that is defined in wp-content/themes/flatsome/assets/js/flatsome.js.

    possible solutions:
    * don’t exclude flatsome (not sure why you had to do so) OR
    * don’t force JS in head OR
    * find out which JS requires Flatsome to be defined and exlcude that as well?

    Thread Starter davenoakes

    (@davenoakes)

    Frank, I owe you a beer!

    After that piece of advice, load times on the live site are around 1.5s everywhere except Melbourne on pingdom!

    So, the reason Flatsome/assets was exluded was because there was a time the header images on the homepage weren’t loading. The people at Flatsome told me there was no need to minify the contents of that folder as they were already minified.

    Oddly, on the live site, simply removing that exclusion has done the trick, whereas on dev. I had to remove that exclusion AND uncheck force JS in head. The only difference between the two sites is that dev. is running on PHP 7.2 and the live site is running on 5.6 (I thought it was worth testing out).

    Anyway, thanks again for all your help! That’s really made a massive change!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Header images not loading when Jscript optimize enabled’ is closed to new replies.