enqueued script with jquery dependency not getting jquery

Put this in your .js file

(function($) {
 // Your code inside here;
})(jQuery);

This is called an anonymous function, you’re passing the jQuery object as a parameter to it.

OR

   var $ = jQuery; // This at the top of the file

This is simple, you’re just assigning the jQuery object to the $ variable

References:

is-not-a-function-jquery-error

jquery-is-not-a-function-error