When using new jQuery 3.5.0 there is an error with missing hasOwnProperty() function for data attributes used here:
Probably the root problem is the fix for this issue in jQuery:
https://github.com/jquery/jquery/issues/3256
Same problem here
same here.
with jquery 3.4.1 works like a charm, with jquery 3.5.0 got the error
Uncaught TypeError: options.hasOwnProperty is not a function
Facing the same issue. With jQuery 3.5.0:
ERROR TypeError: dataAttributes.hasOwnProperty is not a function
at HTMLSelectElement.<anonymous> (bootstrap-select.js:3080)
at Function.each (jquery.min.js:2)
at S.fn.init.each (jquery.min.js:2)
at S.fn.init.Plugin [as selectpicker] (bootstrap-select.js:3070)
at EditCompanyComponent.refreshSelect (edit-company.component.ts:42)
at HTMLDocument.<anonymous> (edit-company.component.ts:27)
at e (jquery.min.js:2)
at t (jquery.min.js:2)
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
at Object.onInvokeTask (core.js:41442)
same here.
with jquery 3.4.1 works like a charm, with jquery 3.5.0 got the error
Uncaught TypeError: options.hasOwnProperty is not a function
I fix it in angular changing the jquery version:
"jquery": "^3.4.1" to "jquery": "3.4.1"
Looks like our best bet (for now) might be to wait for jQuery v3.5.1 for this to get resolved. This issue will probably get reintroduced in jQuery v4.0.0, but I'm hoping we won't need jQuery as a dependency by then.
At this moment (for who wants), it can be solved by altering the code of the bootstrap-select plugin:
Object.prototype.hasOwnProperty.call(options, i)
instead of
options.hasOwnProperty(i)
It can be considered a valid correction afterall because it much safer.
The fix suggested by @didaxRedux will be a part of the next release. Thanks @didaxRedux!
Released in v1.13.15!
Safer way to hasOwnProperty which would have bypassed this issue:
if (Object.prototype.hasOwnProperty.call(dataAttributes, dataAttr) ...
@mryellow Yes, that is the fix we implemented.
same here.
with jquery 3.4.1 works like a charm, with jquery 3.5.0 got the error
Uncaught TypeError: options.hasOwnProperty is not a functionI fix it in angular changing the jquery version:
"jquery": "^3.4.1" to "jquery": "3.4.1"
Yes this is very strange cause everything was working very well with 3.5 and suddenly i got rhe same error few minutes ago. As you said i downgrade my jquery version to 3.4.1 and i m back to business but that's really strange. Because i haven't update anything. Just suddenly the hasOwnProperty error 馃拃. If i found the reason i ll put that here
=> my version is => "bootstrap-select": "1.13.16", && "jquery": "^3.4.1",
same here.
with jquery 3.4.1 works like a charm, with jquery 3.5.0 got the error
Uncaught TypeError: options.hasOwnProperty is not a functionI fix it in angular changing the jquery version:
"jquery": "^3.4.1" to "jquery": "3.4.1"Yes this is very strange cause everything was working very well with 3.5 and suddenly i got rhe same error few minutes ago. As you said i downgrade my jquery version to 3.4.1 and i m back to business but that's really strange. Because i haven't update anything. Just suddenly the hasOwnProperty error . If i found the reason i ll put that here
=> my version is => "bootstrap-select": "1.13.16", && "jquery": "^3.4.1",
right now just update to 1.13.17 and you don't get error anymore.
work fine with jQuery 3.5.0 too
Most helpful comment
same here.
with jquery 3.4.1 works like a charm, with jquery 3.5.0 got the error
Uncaught TypeError: options.hasOwnProperty is not a function