Title: Combining javascript files breaks the navigation block
Last modified: February 3, 2025

---

# Combining javascript files breaks the navigation block

 *  Resolved [gagnieray](https://wordpress.org/support/users/gagnieray/)
 * (@gagnieray)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/combining-javascript-files-breaks-the-navigation-block/)
 * 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 :
 *     ```wp-block-code
       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](https://wordpress.org/support/users/svetoslavvasev/)
 * (@svetoslavvasev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/combining-javascript-files-breaks-the-navigation-block/#post-18282132)
 * Hello [@gagnieray](https://wordpress.org/support/users/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](https://wordpress.org/plugins/sg-cachepress/#developers)
   for any development regarding this case.
 * Best Regards,
 * Svetoslav Vasev
 *  Thread Starter [gagnieray](https://wordpress.org/support/users/gagnieray/)
 * (@gagnieray)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/combining-javascript-files-breaks-the-navigation-block/#post-18282172)
 * Thank you for your answer.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Combining javascript files breaks the navigation block’ is closed to 
new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [gagnieray](https://wordpress.org/support/users/gagnieray/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/combining-javascript-files-breaks-the-navigation-block/#post-18282172)
 * Status: resolved