I attach the datepicker to inputs in a global script file with like this:
$(document).on(\"focusin\",\".datePick\", function () { $(this).datepic
I experienced this exact error, and while my answer will not help the OP, maybe it will help others in the future.
I received this error message when I had an ID clash with another element in my page.