Select2() is not a function Select2() is not a function javascript javascript

Select2() is not a function


I was having this problem when I started using select2 with XCrud. I solved it by disabling XCrud from loading JQuery, it was it a second time, and loading it below the body tag. So make sure JQuery isn't getting loaded twice on your page.


This error raises if your js files where you have bounded the select2 with select box is loading before select2 js files.Please make sure files should be in this order like..

  • Jquery
  • select2 js
  • your js


Had the same issue. Sorted it by defer loading select2

<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.8/js/select2.min.js" defer></script>