We have face problem we implement some slider and also we have wrighten many script in phtml. If we add the jquery library then magento is giving the error in core files and all script are stopped accept my cutome script once i remove the the jquery library then core script are working but my custom script are not working its giving jquery not define you can see error below url.


1 Answer 1


It is not possible to use jQuery without “require(['jquery'],function($){” this code in Magento2.

If you add the jquery library directly in head section for your custom script than the Magento2 is giving the error.

As per Magetno2 coding standard all the external js library you must use using requirejs.

So you can write your any custom script by loading jQuery (or any external library) first using requirejs.

  • have no any way to use without conflict jQuery. :(
    – Puneet
    Commented Sep 4, 2017 at 4:56
  • i think there should a way to use jQuery because in codding have no any impossible things.
    – Puneet
    Commented Sep 4, 2017 at 4:58

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.