In magento 1 when merged javascript files is set to "yes" I encountered this error :

enter image description here

When merged javascript files is set to "No" there was no problem with jquery datepicker.

Do you have any idea how to solve this issue ?



When I click on the error in the console, the end of this line "throw e;}" is underline in red :

return before+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function each(iterator,context){var index=0;try{this._each(function(value){iterator.call(context,value,index++);});}catch(e){if(e!=$break)throw e;}

1 Answer 1


Include the jquery.noConflict in the app/design/frontend/default/[theme name]/template/page/html/head.phtml file

<script type="text/javascript">
  $.noConflict(); //Use no conflict here instead of js file
  // Code that uses other library's $ can follow here.

-if still not working then

Create a different alias instead of jQuery to use in the rest of the script.

<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j( "#datepicker" ).datepicker();
  • Now I have this error : Uncaught TypeError: $.noConflict is not a function
    – Fbr
    Commented Oct 3, 2019 at 14:15
  • Please replace $.noConflict(); with jQuery.noConflict(); Commented Oct 3, 2019 at 14:18
  • Ok it's better, but I still have "JQuery(...).datepicker is not a function" error.And I can't make your second solution, because there was more than 4140 results for .datepicker in my project..
    – Fbr
    Commented Oct 3, 2019 at 14:30
  • If you have included multiple jQuery library then keep only latest version and remove all other jQuery library Commented Oct 3, 2019 at 14:33
  • And check that jQuery library call order is older to latest Commented Oct 3, 2019 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.