Support » Plugin: Autoptimize » WP 5.5 + Woo: Uncaught ReferenceError: wp is not defined

  • Resolved bonovski

    (@bonovski)


    Hi, I updated my staging site to WP 5.5 and Woo 4.3.3.
    I did not change any settings in autoptimize, just cleared the cache.

    I’m getting this error:
    Uncaught ReferenceError: wp is not defined

    referencing this script:

    <script type='text/javascript' id='wp-a11y-js-translations'>( function( domain, translations ) {
    	var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
    	localeData[""].domain = domain;
    	wp.i18n.setLocaleData( localeData, domain );
    } )( "default", { "locale_data": { "messages": { "": {} } } } );</script> 

    When I turn off Aggregate JS-files the error disappears.

    • This topic was modified 1 year, 1 month ago by bonovski.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    from my other reply;

    Excluding just the right files (try wp-includes/js) should help too bonovski.

    Now as you write that does

    adds 12 additional network requests

    but you can try making the exclusion more specific.

    Thread Starter bonovski

    (@bonovski)

    Excluding wp-includes/js/dist/ has fixed the problem.

    • This reply was modified 1 year, 1 month ago by bonovski.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    good to know, thanks for the feedback bonovski 🙂

    frank

    onokazu

    (@onokazu)

    For me excluding only wp-includes/js/dist/i18n.min.js has fixed the issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP 5.5 + Woo: Uncaught ReferenceError: wp is not defined’ is closed to new replies.