Uncaught TypeError: Cannot convert object to primitive value(zone-evergreen.js:171)

﹥>﹥吖頭↗ 提交于 2020-04-29 07:25:22

问题


In Angular 9 (using Bootstrap 4 and Jquery 3.5.1). when clicking on bootstrap collapse button, I am getting an error on my browser console instead of a dropdown menu.

I really don't know where exactly the error came from.

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)

回答1:


This issue seems to be related to jQuery 3.5.0. It is a breaking change that affects many plugins. Temporarily reverting to a previous version of jQuery (like 3.4.1) fixed the issue for me.

Source: jQuery Issue #4665



来源:https://stackoverflow.com/questions/61177140/uncaught-typeerror-cannot-convert-object-to-primitive-valuezone-evergreen-js1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!