Uncaught ReferenceError: wp_localize_script_autocomplete is not defined

  • Bodav
    Participant
    # 2 months, 1 week ago

    hi,
    i enabled the suggestions option, and in incognito i get this js error:
    https://snipboard.io/Rdzn7q.jpg

    should i exclude this file from cache or any known issue?

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    It looks like your HTML code is optimised, and that the WPSOLR javascript variable declaration is deferred, causing the error.

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    I’m building a quick fix right now.

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    Please replace your current WPSOLR version with this release, and clear your caches: https://www.dropbox.com/s/hqj4ia77jloh3rd/wpsolr-pro-fix-js-when-html-optimised.zip?dl=0

    The release includes the following fixes/improvements:
    – Prevent wp_localize_script_autocomplete javascript error when HTML is optimised

    Bodav
    Participant
    # 2 months, 1 week ago

    i excluded this file from deferred but it still is not loading on incognito
    do i need to exclude any other files maybe with it?

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    Did you install the fix and cleared your caches?

    Bodav
    Participant
    # 2 months, 1 week ago

    wow thanks! that was quick

    Bodav
    Participant
    # 2 months, 1 week ago

    i did not see you posted it..installing it right now!

    Bodav
    Participant
    # 2 months, 1 week ago

    still got js error, but changed a bit, cleared caches of course.
    https://snipboard.io/styrNW.jpg

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    Yes, the problem is the same, but in another part of the script.
    But this time, I cannot fix it.
    What kind of tools do you use to optimize your pages?

    Bodav
    Participant
    # 2 months, 1 week ago

    wp-rocket plugin. it does deffer and delay js files
    i’ll try to exclude this file name

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    I’ll try on my environment with WP-Rocket, as it might concern (many) other customers.

    wpsolr
    Keymaster
    # 2 months, 1 week ago

    I could replicate the issue with WP Rocket deferred js loading, but could not find a quick fix.
    Try to add exclusions on file autocomplete_solr.js

    Added to roadmap: https://trello.com/c/HIO2YKFA/179-fix-issue-with-deferred-js-loading-with-wp-rocket

    Bodav
    Participant
    # 2 months, 1 week ago

    added it to all the exclusions..but it depends on Jquery that also needs to be excluded and there im stuck

    Bodav
    Participant
    # 2 months, 1 week ago

    ok fixed it for now, with excuding jquery from delay and deffer, just use this string in wp rocket exclude on deffer and delay js:
    /jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
    screenshot
    https://snipboard.io/Bc3uvl.jpg

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.