X-menu.js error

Good morning.

Trying to resolve an issue with a plugin in the admin menus screen, and I’m getting an error in my browser console. It’s reporting that it 'failed to load resource: the server responded with a status of 404 (Not found) the file ‘/domain/wp-content/themes/pro/framework/dist/js/admin/x-menus.js.map’

It seems checking other pages (frontend and backend) .js files that exist are being given a further extension .map? Checking in Chrome this doesn’t happen, so maybe a Safari thing?

But this investigation has raised a concern. I have a large menu with many items. Using the 2017 theme, it loads quickly and downloads 3.78MB. When using the PRO theme, it loads VERY slowly and downloads 48.2MB to display the same menu.

Look forward to your response and advice.

Thanks

Hi There @ashleybassett

Thanks for writing in! I see that you have withdrawn your post. By the way, those errors are just missing source-maps. They are requested by developer tools (especially in Safari) when possible, but won’t interfere with anything.
Basically it’s a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location.

Please check out this link: https://stackoverflow.com/questions/19550060/how-do-i-toggle-source-mapping-in-safari-7/19823890#19823890

Hope this helps.

Thanks for that explanation. What about the theme generating a large download for the admin menu page?

Hey @ashleybassett,

I’m sorry but it’s actually impossible to answer that question without us knowing your exact setup. I’m looking at my test site now with latest version of Pro and I don’t get that issue. Ensure you’re also using the latest version.

Please give us details on how to replicate that issue. More screenshots would also be helpful. Also give us WordPress admin access in a Secure Note

Thanks.

Thanks Details included below.

Hi @ashleybassett

I tried to log in with these credentials but I couldn’t, could you please recheck them for us?

Thanks.

Apologies - should work now.

Hello There,

I have logged in and I have seen that your menu has over a hundred menu items. And each of this items will be run through the loop so that X menu settings can be added. This could be the cause why it took a while to load the menu page.

If you try a different theme like the Twenty Seventeen, it loads a little faster because none of the X menu settings is present.

Hope this helps.

Thanks. I don’t use these x-menu settings. Is there a way to switch this off. This would help when I’m working remotely.

Thanks

Hello There,

The X menu settings were coded built in within Cornerstone. Regretfully there is no way you can switch it off. I could recommend that if you are working remotely, temporarily deactivate Cornerstone and work on your menus. Once you are done, you can reactivate it again to display the pages correctly.

Hope this helps.

OK - Thanks.

How do I switch off cornerstone. I don’t use the cornerstone editor at all.

Hi @ashleybassett,

You can’t disable cornerstone permanently, it’s a required plugin for the theme to properly work. And it’s not possible in Pro theme. And there is a confusion, that X menu settings are part of the theme since it’s integrated to the header menu. Perhaps you could provide more information of we can reproduce the download issue of 48.2MB? Not sure where to look at especially you’re referring to the menu.

Plus, those settings are empty so there should be no effect in performance, else, we should get the same loading issue. I checked and it’s loading fast on my end.

Thanks!

Thanks and for explaining the misinformation.

I’ve provided the credentials above. If you open the menu page, you’ll see that on the console its downloading x15+ the amount of data than it normally would. As you say, all the settings are empty. The speed is proportional to the speed of your internet connection!

Feel free to have a look!

It’s quicker at home - have a faster connection - but I do most of the work in the office!

A

Hey @ashleybassett,

Sorry for the confusion. @RueNel is correct. The custom fields of the menu item is coming from Cornerstone and it is connected to the Navigation elements and you’re seeing 48mb because of the additional nodes (menu item custom field). I have tested this in my dummy site.

There’s a way to remove the menu item custom fields but, please note that this is not recommended. Please use this at your own risk. We are not responsible for the effects that this code will do to your site. And, if this does not work on your end, you will need to consult with a third party developer.

Add this code to your functions.php.

add_action('init', 'remove_these', 10 );

function remove_these() {
	remove_all_actions( 'wp_nav_menu_item_custom_fields', 10);
    remove_all_actions( 'wp_update_nav_menu_item', 10 );
    remove_all_filters( 'manage_nav-menus_columns', 10 );
}

When the menu item custom fields were removed in my test site, the size went down. But, please note that this is not an issue with the theme. It’s not recommended to have a lot of menu items in your page so your use case is unique.

Thanks.

Many thanks for your guidance - really appreciated!

We are glad we were able to help, you are welcome :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.