• Resolved terrim

    (@terrim)


    Hi

    I’ve noticed that for the past few days quite a few Uncaught TypeError issues have popped up within the inspect console. Which look like:

    TypeError: can't access property "interpreters", l is undefined
    getIndicatorForScore wp-content/uploads/siteground-optimizer-assets/yoast-seo-frontend-inspector-resources.min.js:1
    d wp-content/plugins/wordpress-seo-premium/assets/js/dist/frontend-inspector-2290.min.js:1
    React 2
    ye wp-content/plugins/wordpress-seo-premium/assets/js/dist/frontend-inspector-2290.min.js:1
    React 11
    <anonymous> wp-content/plugins/wordpress-seo-premium/assets/js/dist/frontend-inspector-2290.min.js:1

    These errors disappear when I deactivate the Speed Optimizer plugin. Could you please tell me what could be causing the issue and how we can fix it?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Preslav Kenanov

    (@preslavkenanov)

    Hello @terrim,

    The “siteground-optimizer-assets” folder contains all the minified and combined JS/CSS scripts of your website. The actual scripts, however, are generated by your application. In other words, the issue at hand is not a direct result of the Speed Optimizer plugin, but the “frontend-inspector-2290.min.js” script which is generated by the Yoast SEO plugin.

    What I can recommend is to make sure that you have the latest version of the Yoast plugin installed on your website. You may also try to re-install the plugin to ensure that all of the core files are in place and none of them are corrupted.

    Since you have mentioned that the issue disappears when you disable the Speed Optimizer, you may try to exclude the affected script from JavaScript combination:

    https://eu.siteground.com/tutorials/wordpress/speed-optimizer/frontend-optimization/#Combine_CSS_and_JS_files

    However, it is likely that the underlying issue with the script will remain, so if updating/re-installing the Yoast plugin does not resolve the issue you may consider reaching out to the plugin’s vendors for more information.

    Kind Regards,
    Preslav Kenanov

    Generosus

    (@generosus)

    Hey @terrim,

    Many issues can be solved by deactivating the Speed Optimizer (SO) setting that is causing the issue (vs deactivating completely the plugin). Did you try that?

    Also, you can try the following:

    1. Disable CSS, JS, and HTML minification.
    2. Exclude the affected JS file (frontend-inspector-2290.min.js) from both combination and deferral using the exclusion dropdowns.
    3. If the affected JS file does not appear in the exclusions dropdown list, use the appropriate SO JS combine and defer exclusions filter (i.e., code snippet) to exclude it. Namely,
    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';

    return $exclude_list;
    }

    and

    add_filter( 'sgo_js_async_exclude', 'js_async_exclude' );
    function js_async_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';

    return $exclude_list;
    }

    Where the ‘script-handle‘ of the affected JS file can be obtained by temporarily using the following code snippet and performing a page souce inspection (i.e., “View page source”) of your affected website page.

    add_filter( 'script_loader_tag', 'cameronjonesweb_add_script_handle', 10, 3 );
    function cameronjonesweb_add_script_handle( $tag, $handle, $src ) {
    return str_replace( '<script', sprintf(
    '<script data-handle="%1$s"',
    esc_attr( $handle )
    ), $tag );
    }

    Hope this helps a bit. Best wishes!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.