Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap v4.4.1 collapse doesn't work with jQuery v3.5.0 #30553

Closed
waclaw66 opened this issue Apr 11, 2020 · 29 comments · Fixed by #30559
Closed

Bootstrap v4.4.1 collapse doesn't work with jQuery v3.5.0 #30553

waclaw66 opened this issue Apr 11, 2020 · 29 comments · Fixed by #30559

Comments

@waclaw66
Copy link

waclaw66 commented Apr 11, 2020

Hello together,

after upgrade to jQuery 3.5.0 I'm getting an exception
TypeError: Cannot convert object to primitive value
while clicking to navbar-toggler button

It leads to the line

if (!data && _config.toggle && /show|hide/.test(config)) {

Works fine with jQuery 3.4.1.

Any system and browser.

@xpressabhi
Copy link

Not working for me as well, by mistake just created new issue.

@sharkykh

This comment has been minimized.

@alliedarmour
Copy link

I have the same problem, in this case my navbar is not working anymore. It surely is the update to 3.5.0 which is causing the problem.

@XhmikosR
Copy link
Member

I was actually just going to make a new issue to update jQuery to v3.5.0 in v4-dev.

https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

I'll check now if we have any failing tests.

@XhmikosR
Copy link
Member

jquery/jquery#4665

So, it seems they will make a patch release to fix this behavior.

@Johann-S do you think we should do anything in our code? I don't know when jQuery v4.0.0 will be out, but any fixes we make will probably be future proof.

@XhmikosR
Copy link
Member

I was able to reproduce the error after updating to v3.5.0 and adapting our tests in #30559.

@aldyahsn
Copy link

For me, the console error says
TypeError: can't convert config to string

@XhmikosR XhmikosR changed the title BS 4.4.1 Collapse doesn't work with jQuery 3.5.0 Bootstrap v4.4.1 collapse doesn't work with jQuery v3.5.0 Apr 11, 2020
@XhmikosR
Copy link
Member

After some digging around, it seems this code exists since 2015: 872e56f

Let's wait and see what the jQuery developers will say in jquery/jquery#4665

@XhmikosR
Copy link
Member

Can someone try #30559?

https://deploy-preview-30559--twbs-bootstrap.netlify.com/docs/4.4/dist/js/bootstrap.js
https://deploy-preview-30559--twbs-bootstrap.netlify.com/docs/4.4/dist/js/bootstrap.min.js
https://deploy-preview-30559--twbs-bootstrap.netlify.com/docs/4.4/dist/js/bootstrap.bundle.js
https://deploy-preview-30559--twbs-bootstrap.netlify.com/docs/4.4/dist/js/bootstrap.bundle.min.js

Our tests seem to pass there. We'll see if/when we can release v4.4.2, but until that happens or until jQuery releases a new patch version people should be careful with the v3.5.0 update.

@sharkykh

This comment has been minimized.

@XhmikosR
Copy link
Member

v3 is EOL. I doubt we'll backport this, sorry.

mattgodbolt added a commit to compiler-explorer/compiler-explorer that referenced this issue Apr 11, 2020
@alazark94
Copy link

alazark94 commented Apr 12, 2020

in node_modules/bootsrap/dist/js/bootstrap.js line 1509 change

if (!data && _config.toggle && /show|hide/.test(config))

to

if (!data && _config.toggle && /show|hide/.test(_config))

or use jquery 3.4.1 until twbs/bootstrap#30553 is fixed

@XhmikosR
Copy link
Member

XhmikosR commented Apr 12, 2020 via email

@XhmikosR
Copy link
Member

Nope, doesn't work because _config is still an Object.

@alazark94
Copy link

I've tried it multiple times and it's working for me.

@waclaw66
Copy link
Author

waclaw66 commented Apr 12, 2020

_config works for me too in this particular case.

Nope, doesn't work because _config is still an Object.

@nixprosoft

This comment has been minimized.

@XhmikosR
Copy link
Member

I've tried it multiple times and it's working for me.

Yeah, but our test suite doesn't work.

@XhmikosR
Copy link
Member

Everyone interested in this should follow our #30559 PR and the upstream jQuery issue jquery/jquery#4665.

It seems the jQuery developers plan to release a fix for the error that is affecting us, but my plan is to also land #30559 for v4.

@XhmikosR XhmikosR pinned this issue Apr 14, 2020
@yickson
Copy link

yickson commented Apr 14, 2020

Downgrade to Jquery 3.4.1 and work again, thanks.

@ghost
Copy link

ghost commented Apr 14, 2020

@yickson isn't work with me.
here's my Dependencies

"bootstrap": "^4.4.1",
"jquery": "^3.4.1",
"popper.js": "^1.16.1"

in my console error

TypeError: can't convert config to string main.js line 120 > eval:1508:52

@yickson
Copy link

yickson commented Apr 14, 2020

@yickson isn't work with me.
here's my Dependencies

"bootstrap": "^4.4.1",
"jquery": "^3.4.1",
"popper.js": "^1.16.1"

Bootstrap 4.4.1 Not work with Jquery 3.4.1, unfortunately, I use bootstrap 3.3.7 with Jquery 3.4 by compatibility.

@alazark94
Copy link

Change it to
“jquery”: “3.4.1”

Just remove the ‘^’ character

@ghost
Copy link

ghost commented Apr 14, 2020

@alazark94 thanks bruh!, work as fine

fisharebest added a commit to fisharebest/webtrees that referenced this issue Apr 14, 2020
@JiresAng
Copy link

Try to change your v3.5.0 to 3.4.1, downgrade your jQuery

@valentijnscholten
Copy link

I have the same issue with popover. With jQuery 3.4.1 it works and the dataAttributes variable is a full javascript object, which has the hasOwnProperty as function. In jQuery 3.5.0 the dataAttributes variable is just a dictionary or whatever I should call it. It has no object functions such as hasOwnProperty.

image

image

@nicholastic
Copy link

jQuery 3.5.0 also won't work with Bootstrap 3.4.1. Dropdowns and collapse don't work. Reverted to jQuery 3.4.1 to make it work.

@twbs twbs locked and limited conversation to collaborators Apr 15, 2020
@XhmikosR
Copy link
Member

Fixed in #30559.

@ffoodd ffoodd unpinned this issue Apr 20, 2020
@XhmikosR XhmikosR pinned this issue Apr 24, 2020
@XhmikosR
Copy link
Member

XhmikosR commented May 5, 2020

jQuery v3.5.1 was released a few hours ago. This should work with Bootstrap 4.x fine.

@XhmikosR XhmikosR unpinned this issue May 12, 2020
erseco referenced this issue in CTFd/CTFd May 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.