Uncaught ReferenceError: $ is not defined

Hi,

I’m getting this error in the console at random times on random pages (usually product pages). In this case it messes up an Off-Canvas module from UABB and makes the page appear unstyled:

Sometimes the error appears on a given page and sometimes it doesn’t and it does not appear on every product page even though the pages are built using the same modules (saved modules). If you browse around the site and look at multiple products, the problem seems to appear on 10-20% of the cases but the affected pages circulate. I usually fix the issue by clearing the BB cache but that does not always work. And then when the problem disappears, it pops up a few minutes later on some other product page.

Here is an example of a product page: https://www.abelstedt.com/jewelry/rings/oxford-ring-rcss0039a/. You can browse other product pages in the slider below the product summary and the error should eventually appear on a random page.

What I’ve derived from reading around similar cases on the web is that it seems BB tries to load javascript before jQuery is loaded on the page which causes the error. I’m not an expert so I wouldn’t know how to solve it.

I have discussed the issue with our hosting provider who handles the caching on the page. The problem still appears even though caching is completely turned off on the site. I was told that it is a pure javascript issue but I was not provided with a solution to fix it.

I hope anyone here would know of a possible solution since this is a very annoying problem that we have dealt with since building the site from scratch some weeks ago. We use the Astra theme, Beaver Builder, and Ultimate Add-Ons for BB and the problem occurred even when these plugins/themes were the only things installed on the site. So I can confirm that it’s not some other plugin interferring. I’ve tried disabling all other plugins afterwards to make sure but the problem still appears.

Lastly, it appears even though I’m logged in as admin or checking the site in incognito with a cleared browser cache.

Hello,

Thanks for your question.

From the above error, it seems like, your jQuery is somehow not included in your webpage or there is more than one jquery library is included in the webpage and they are clashing with each other.

If that is the problem then please remove one from your project and try again.

If still does not resolve then please include properly in your project either globally or locally in your project file and run the demo function of Ajax.

Run the function like jQuery.ajax() or $.ajax() to check if it is working or not.

Also, check the version of your jQuery. Sometimes that can be also the problem.

Best Regards,

Since this relates to a UABB module, I’d recommend you reach out to them.

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