JavaScript x-head / x-body loaded twice

Hello,

I am starting to use WebPack to combine all JS, CSS and speed up my site. I find the following script to be loading twice:

<script type='text/javascript' src='https://marcsmits.eu/wp-content/themes/x/framework/js/dist/site/x-head.min.js?ver=5.2.1'></script>
<script type='text/javascript' src='https://marcsmits.eu/wp-content/themes/x/framework/legacy/cranium/js/dist/site/x-head.min.js?ver=5.2.1'></script>

The same thing happens for x-body.min.js.

  • Why does this happen?
  • How do I fix this?

Best regards,

Marc

Hi Marc,

Thank you for writing in, those files have the same name but they have different content, you can check that by pasting those URL directly into your browser.

Combining all JS files in one file sometimes can cause a conflict, If this is the case please exclude those files (theme resources) from combining. They’ve minified anyway so it should not hinder your page loads.

Cheers!

Thanks for the advice @friech.

Hi @ctrlspatie,

Feel free to ask us again.

Thanks. :slight_smile:

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