jQuery 3.5.0 and Bootstrap 4.4 Issues

If you are trying to use jQuery 3.5.0 and Bootstrap 4.4, you will come across an error something like this:

Can't convert object to primitive value(zone-evergreen:171).


Uncaught Type Error: Cannot convert object to primitive value(zone-evergreen.js:171 )
    at RegExp.test (<anonymous>)
    at HTMLDivElement.<anonymous> (bootstrap.bundle.min.js:6)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at S.fn.init.a._jQueryInterface [as collapse] (bootstrap.bundle.min.js:6)
    at HTMLDivElement.<anonymous> (bootstrap.bundle.min.js:6)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at HTMLButtonElement.<anonymous> (bootstrap.bundle.min.js:6)
    at HTMLDocument.dispatch (jquery.min.js:2)

This happened to me when I was trying to use the latest Bootstrap with jQuery in my Angular project.

The best solution that I could do was to use an earlier version of jQuery.

To do this, use the npm command:

npm install --save jquery@3.4.1

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top