Uncaught Reference Error $ is not defined

32 0 12

I am receiving the above error when i inspect my site. it appears to be referring to the following (the line in bold/red) in my theme.js file:

var adjustStyleAndPosition = theme.Helpers.debounce(function() {
$(selectors.multicurrencySelector).on('change', function() {
}, 50);

and this one:

var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);

can anyone help me out with fixing this?



Replies 8 (8)
Shopify Expert
727 49 198

That error means that jQuery is not loaded on the site when that code runs. This could either be because jQuery is not added to the theme at all or it is deferred and loading AFTER this code runs.

32 0 12

Thank you @gina-gregory - is this a big issue that will affect the site functioning?

Shopify Expert
727 49 198

Yes, any code dependent on jQuery will not work if the jQuery library is not present when it tries to run.

42 0 3

Same Problem.

Did you get any solution?

Please let me know.

Shopify Partner
525 55 95

Hello , @designrepo 

Please add this line of code :- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

into your theme.liquid file after <head>

Ittanta Technologies Pvt. Ltd. | Shopify Expert
If reply is helpful, please Like and Accept Solution.
To hire us, contact us at info@ittanta.com
42 0 3

Thank you.!

New Member
4 0 0

If you are using any script file and getting "Uncaught ReferenceError: x is not defined " which means ‘x’ is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this ‘x’ is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the ‘x’.

To solve this error: Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)


New Member
1 0 0

This worked like a charm, thank you!