未捕获的类型错误:无法将对象转换为原始值(zone-evergreen.js:171)

Roh*_*mar 41 bootstrap-4 angular9

在Angular 9(使用 Bootstrap 4 和 Jquery 3.5.1)中。单击引导程序折叠按钮时,我在浏览器控制台而不是下拉菜单上收到错误消息。

我真的不知道错误究竟来自哪里。

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)
Run Code Online (Sandbox Code Playgroud)

jas*_*end 102

这个问题似乎与 jQuery 3.5.0 有关。这是一个影响许多插件的重大更改。暂时恢复到以前版本的 jQuery(如 3.4.1)为我解决了这个问题。

来源:jQuery 问题 #4665

更新:

jQuery 3.5.1 恢复了破坏性更改,使用起来应该是安全的。

公告:jQuery 3.5.1 发布:修复回归

  • 就我而言,我的引导手风琴停止工作。也就是说,点击卡片标题并没有打开卡片。“npm i jquery@3.4.1”修复了“无法将对象转换为原始值”问题。 (9认同)