• Resolved p15h

    (@prestonwordsworth)


    Dear Livan

    We observed a ReferenceError: Can't find variable: wp error in browser consoles after checking ‘Defer loading JavaScript’ in the plugin. It is related to the following inline scripts:

    <script src='/wp-includes/js/dist/i18n.min.js' defer='defer' id='wp-i18n-js'></script>
        <script id='wp-i18n-js-after'>
        wp.i18n.setLocaleData({
            'text direction\u0004ltr': ['ltr']
        });
        </script>

    I was wondering if it is possible to get round this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter p15h

    (@prestonwordsworth)

    After some more testing, it turns out the error with <script id='wp-i18n-js-after'> was in fact caused by /wp-content/plugins/elementor-pro/assets/js/frontend.min.js being mistakenly deferred.

    The real issue seems to be this: even though the plugin is said to ‘Defer loading JavaScript combined files from?<body>?(applies?defer="defer"?attribute to the combined script tags)’, it applies the attribute even to those scripts excluded from the combined files when the box in question is checked.

    Looking forward to a fix in the next release.

    Thread Starter p15h

    (@prestonwordsworth)

    Was mistaken about the scripts that caused ReferenceError: Can't find variable: wp. The culprit was hooks.min.js and i18n.min.js being deferred even when excluded from the combined js file (n.b. i18n.min.js is excluded by default).

    Our temporary fix is to use another plugin to handle the minify/aggregate/defer of js.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conflict with i18n.min.js in core’ is closed to new replies.