• Resolved The-Dude

    (@the-dude-1)


    Hi,

    in the browser console i see two errors:

    Uncaught ReferenceError: wp is not defined
    and
    Uncaught ReferenceError: _ is not defined

    According to the linked sources i found these lines that causes the problem:

    
    <script type='text/javascript' id='wp-i18n-js-after'>
                wp.i18n.setLocaleData({
                    'text direction\u0004ltr': ['ltr']
                });
    </script>
    <script type='text/javascript' id='lodash-js-after'>
                window.lodash = _.noConflict();
    </script>

    Could you please have a look at them.

    Thx 🙂

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Contributor dudo

    (@dudo)

    Hello, are you using a caching plugin?
    Can you provide link?

    Thanks

    Thread Starter The-Dude

    (@the-dude-1)

    Hi,

    yes i use caching plugins.

    Cache Enabler
    Warm Cache
    Autoptimize

    https://www.smarthomearea.de

    • This reply was modified 3 years ago by The-Dude.
    Plugin Contributor dudo

    (@dudo)

    If you try to open your site with autoptimize off (https://www.smarthomearea.de/?ao_noptimize=1 ) it is working, so it is a conflict with Autoptimize.

    I’ve been able to make it work on my local envirnoment by disabling “Aggregate JS-files?” in AO setting, but maybe @futtta can help us more 🙂

    Best,
    Dario

    Optimizing Matters

    (@optimizingmatters)

    Well, given the error you’ll probably have to add wp-includes/js to the comma-separated JS optimization exclusion list.

    Thread Starter The-Dude

    (@the-dude-1)

    Thanks both, but it didn’t work. ;( The errors are still visible in my console.
    Any hints?

    Optimizing Matters

    (@optimizingmatters)

    can you share a screenshot (upload it to imgur.com or similar and share URL) of your current Autoptimize JavaScript settings the-dude-1 ?

    Thread Starter The-Dude

    (@the-dude-1)

    Sure

    View post on imgur.com

    JS optimization exclusion list:
    js/jquery/jquery.min.js,js/jquery/jquery.js,shariff.js,reviewer-reviews-boxes.js,s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,nonce,post_id,wp-includes/js

    Asynchrone JavaScript-Files:
    analytics.js,linkid.js,rum.js,m_js_controller.js,m_js_controller_fy2019.js,abg_lite.js,qs_click_protection_fy2019.js,qs_click_protection.js,error_handler.js,window_focus.js,window_focus_fy2019.js,init.js,pub.420451.min.js,email-decode.min.js

    Optimizing Matters

    (@optimizingmatters)

    not sure what (maybe just page caching?), but something is wrong, because as per the HTML source jQuery and the other JS in wp-includes/js is not being excluded, it is missing in the HTML … :-/

    Thread Starter The-Dude

    (@the-dude-1)

    Don’t know what you wanna say with “…ut something is wrong, because as per the HTML source jQuery and the other JS in wp-includes/js is not being excluded, it is missing in the HTML…” . Could you please be clearer? 🙂

    Optimizing Matters

    (@optimizingmatters)

    that despite the exclusions seem not to work, as the JS is not excluded from aggregation. maybe clear all page caches you might have?

    Thread Starter The-Dude

    (@the-dude-1)

    I’ve deleted all caches (plugins, browser, CDN-Caching (Cloudflare)).
    The errors in the console are still their (please have a look) … but the website works still without any malfunctions. Very strange …

    Optimizing Matters

    (@optimizingmatters)

    if everything works then you _could_ ignore the errors, but the exclusions still do not “take”. could be a plugin conflict maybe?

    Plugin Contributor dudo

    (@dudo)

    Well, given the error you’ll probably have to add wp-includes/js to the comma-separated JS optimization exclusion list.

    This worked in my local environment. ( https://snipboard.io/5yJaZF.jpg )

    @the-dude-1 can you try to insert it at the begin of the excluded scripts, and then delete again ALL your caches? (Cache Enabler, Warm Cache, cdn if you use…)

    • This reply was modified 3 years ago by dudo.
    Thread Starter The-Dude

    (@the-dude-1)

    Changing the position from the end to the beginning of the exclusion list has no effect. ;(
    All cashes are flushed.
    But i’ll wait 24 h. Maybe the errors will disappear after a while.
    I’ll give you feedback.

    Thread Starter The-Dude

    (@the-dude-1)

    Hi, after 48 h sadly the errors are still visible in the console. ;(

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Uncaught ReferenceError: wp is not defined, _ is not defined’ is closed to new replies.