Magento – Magento 2 Error in browser console Expected to start loader but did not find one in the dom

ajaxconsolemagento2magento2.2

I have developed site in Magento 2.2.0 and created custom product listing page.

I have used add to cart functionality using ajax but in console giving error:-

"VM1386:5 Expected to start loader but did not find one in the dom"

Any help will appreciate. Thanks.

Best Answer

I was facing add to cart issue after products loaded from ajax. I simply called catalogAddToCart function in my js success function and it worked. Please try this, hope it will resolve your issue.

jQuery( "form[data-role='tocart-form']" ).catalogAddToCart();
Related Topic