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

前端 未结 4 2013
无人共我
无人共我 2020-12-29 19:07

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

相关标签:
4条回答
  • 2020-12-29 19:23

    Just found this issue too, so moved from 3.5.0 to 3.5.1 (latest) and error is gone

    0 讨论(0)
  • 2020-12-29 19:31

    At today's answer, jquery already fix the issue and you don't have to do any regression.

    Just uninstall jquery, install it again and the latest 3.5.1 version, released on 2020-05-04, should fix the problem - for me it did, and I'm also using Angular 9 and BS4*
    A beauty - back to normal.

    0 讨论(0)
  • 2020-12-29 19:37

    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

    Update:

    jQuery 3.5.1 reverts the breaking change and should be safe to use.

    Announcement: jQuery 3.5.1 Released: Fixing a Regression

    0 讨论(0)
  • 2020-12-29 19:40

    They have a fix for that now (see https://github.com/jquery/jquery/commit/65e909844c2d064606217b47e92eff12ebdb79de) if you are up to building your own jquery using node/npm then just download the commit on the link above and build it.

    What I did was to edit my jquery.min.js (3.5.0)

    Steps I did:

    1. search for the line: return t||(t=Object.create(null) it's in Line 2,Column 32856
    2. replace Object.create(null) with {}

    and that's it so far so good

    0 讨论(0)
提交回复
热议问题