Skip to main content
2 of 2
Improvement
Shoaib Munir
  • 9.6k
  • 10
  • 53
  • 108

Magento 2: Uncaught Error: cannot call methods on modal prior to initialization; attempted to call method 'show' when calling bootstrap modal

I am getting error when I am calling modal like this

setTimeout(function() { $('#site-pop-up').modal('show'); }, 2000);

Error in console:

Uncaught Error: cannot call methods on modal prior to initialization; attempted to call method 'show'

Anyone have solution for this?

Thanks

Shomita
  • 1.1k
  • 1
  • 12
  • 40