Why are console errors appearing on my website's first load?

Solved

Why are console errors appearing on my website's first load?

Glenn_Marcus
Shopify Partner
1 0 0

Hello,

My site https://skinshape.com/

is getting console errors on first launch. If I refresh the browser, errors go away.

 

The javascript errors are preventing my site from showing images on the home page. I have a slideshow below the menu, but no images are being displayed in the slideshow.

 

I am using Safari on a Mac in "Private" mode meaning no other browser extensions are running.

 

Here are the console error messages:

 

[Error] ReferenceError: Can't find variable: jQuery
Global Code (api.jquery-e94e010e92e659b566dbc436fdfe5242764380e00398907a14955ba301a4749f.js:1:5310)

[Error] ReferenceError: Can't find variable: jQuery
Global Code (plugins.js:1:32804)

[Error] ReferenceError: Can't find variable: $
(anonymous function) (site.js:1:578)
Global Code (site.js:1:59448)

[Info] Successfully preconnected to https://cdn.shopify.com/ (x4)

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (favicon.ico, line 0)

 

Screenshot

 

CleanShot 2023-05-26 at 13.25.47.jpeg

Accepted Solution (1)

PageFly-Oliver
Shopify Partner
878 190 186

This is an accepted solution.

Hi @Glenn_Marcus,

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at the <body> ⇒ save

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

Hope my solution works perfectly for you.

Cheers!

Oliver | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 2 (2)

NomtechSolution
Astronaut
1245 113 159

The console errors you're experiencing indicate that jQuery is not being loaded properly on the initial page load, which is causing subsequent JavaScript errors and issues with image display. Here are some steps you can take to troubleshoot and resolve the problem:

  1. Check jQuery loading order: Make sure that jQuery is being loaded before any other JavaScript files that depend on it. Verify that the <script> tag for jQuery is present in your theme's HTML, and it's placed before other scripts that use jQuery.

  2. Ensure jQuery is included in your theme: Check your theme's code files to confirm that jQuery is included. In Shopify themes, jQuery is typically included by default, but if it's missing or modified, you may encounter issues. Look for references to jQuery, either as a local file or from a CDN (Content Delivery Network).

PageFly-Oliver
Shopify Partner
878 190 186

This is an accepted solution.

Hi @Glenn_Marcus,

 

You can try this code by following these steps: 

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at the <body> ⇒ save

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

Hope my solution works perfectly for you.

Cheers!

Oliver | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.