Product page speed issue

i have a sofine theme also i added some custom blocks on product detail page… i am having speed issue on product page it loads to slow. here is the link below

1 Like

@tim_1 can you please assist on this

This is due to problems with some Javscript errors in console:

This happens because instruction to load jQuery library has “defer” attribute set. Need to remove it.

The theme demo store does not have “defer” on this line:

@sajeelbaig ,

You website is having console errors,

Uncaught ReferenceError: $ is not defined
Uncaught ReferenceError: jQuery is not defined

What this means

This error happens when code tries to use jQuery ($) before jQuery has been loaded in the page.

  • $ is the jQuery alias
  • If jQuery wasn’t loaded yet, JS can’t find it → throws a ReferenceError
  • This stops other scripts from running properly

These kinds of errors are common when:

  • jQuery script is missing
  • The order of scripts is wrong
  • Scripts dependent on jQuery load before jQuery

Why this matters

Because many Shopify themes and apps rely on jQuery:

  • If it’s not loaded before scripts that reference $ or jQuery, the console will show this error
  • This can also slow page performance and break features

Quick fix

Make sure this loads before all other scripts that use $ or jQuery:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

Or ensure your jQuery include is placed above other JavaScript files in theme.liquid.

Hi @sajeelbaig

Please check the console — these errors are appearing. Can you resolve them?

Errors:

Uncaught ReferenceError: jQuery is not defined
Uncaught ReferenceError: $ is not defined
Uncaught SyntaxError: Unexpected token ‘<’

Best regards,
Devcoder :laptop:

Hi , @sajeelbaig
I checked your page using Pagespeed Insight https://pagespeed.web.dev/analysis/https-justforyoushop-com-products-heritage-eau-de-parfum-100ml-fresh-floral-sweet-coconut-scent-soft-fruity-musky-fragrance-unisex-perfume/eutgk43gsg?form_factor=mobile .Since you added custom blocks on the product page, the slowdown is likely coming from extra scripts or heavy sections loading there.

A few quick things to check :

  1. Test custom blocks
    Temporarily disable the blocks you added one by one and check the speed. Sometimes a single block can add extra JS/CSS.

  2. Optimize product images
    Make sure images are properly sized and compressed (WebP if possible)

  3. Reduce render-blocking resources

Stops the page from displaying until the file finishes loading, which slows down page speed.

< script src=“script.js”>

< link rel=“stylesheet” href=“styles.css”>

Start by disabling the recently added blocks and testing again. Once you identify the heavy section, optimizing images or deferring scripts usually improves the product page speed significantly.

If manual optimization becomes difficult, some site speed optimization apps can help automate image compression and script management

Disclaimer : I’m affiliated with one app called Website Speedy. It is completely optional to use.