• Resolved gagnieray

    (@gagnieray)


    On a default WordPress install with only “Twentytwentyfive” theme and “Speed Optimizer” plugin installed and activated, an error is thrown in the console breaking the menu on mobile when “Combine JavaScript Files” is enabled.

    Uncaught SyntaxError: import declarations may only appear at top level of a module, which is related to the js module /wp-includes/js/dist/script-modules/block-library/navigation/view.min.js

    Using the following code snippet mentioned in the documentation was the only way to fix that :

    add_filter( 'sgo_javascript_combine_exclude_ids', 'js_sgo_javascript_combine_exclude_ids' );
    function js_sgo_javascript_combine_exclude_ids( $exclude_list ) {
    $exclude_list[] = '@wordpress/block-library/navigation/view-js-module';
    return $exclude_list;
    }

    But is it the only and proper way to fix this issue, or is this a bug of the plugin ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Svetoslav Vasev

    (@svetoslavvasev)

    Hello @gagnieray ,

    Thank you for the detailed information. It has already been passed to the plugin developers and a fix is expected to be released with the next plugin update.

    You can follow the plugin’s?updates and changelog?for any development regarding this case.

    Best Regards,

    Svetoslav Vasev

    Thread Starter gagnieray

    (@gagnieray)

    Thank you for your answer.

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