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

Breaks jQuery for versions >=0.3.2 #39

Open
fynsta opened this issue Jun 20, 2024 · 8 comments
Open

Breaks jQuery for versions >=0.3.2 #39

fynsta opened this issue Jun 20, 2024 · 8 comments

Comments

@fynsta
Copy link

fynsta commented Jun 20, 2024

We use jQuery via the jquery-rails gem. Upgrading the debugbar to 0.3.2 just completely breaks the jQuery installation (via the debugbar_head helper where it loads the script).

With this issue:

$.fn // => undefined

And after commenting out = debugbar_head if Rails.env.development?

$.fn // => {jquery: '3.7.0', length: 0, toArray: ƒ, get: ƒ, pushStack: ƒ, …}

This happens no matter which file is required first.

@julienbourdeau
Copy link
Owner

I'm looking at the diff and I don't get how 0.3.1 could work but the later versions 🤔
63d99c6...6df7e2e

I'm assuming you don't get any error in the console and you ran assets:precompile.

@fynsta
Copy link
Author

fynsta commented Jul 17, 2024

Yes. I was looking through the same diff and could not figure it out. The same behaviour has been observed by other members of the team when switching back-and-forth between versions of this gem.

@erwin
Copy link

erwin commented Jul 23, 2024

I'm seeing this too when running on top of Solidus, which has jquery baked in for the /admin site...

@fynsta any tips if you were able to find a work around?

@julienbourdeau such a cool looking tool! awesome!

@fynsta
Copy link
Author

fynsta commented Jul 23, 2024

@erwin No sorry, we just rolled back to 0.3.1. and are running that one for now.

@epugh
Copy link

epugh commented Jan 7, 2025

I had luck doing this:

var $j = jQuery.noConflict();

And then using $j instead of $ everywhere... Not an ideal fix...

Here is the commit that demonstrates this workaround: o19s/quepid@d1a002f#diff-8fa62161b01787efd56863c19b7e712a949073dc606415d6d8cfe319ecc689ecR61

@julienbourdeau
Copy link
Owner

I'll try to setup o19s/quepid to see if I figure out the jquery issue

@epugh
Copy link

epugh commented Jan 7, 2025

To run quepid, check out the source and it assumes you have ruby installed locally (3.3.6). it runs in docker, so ..

bin/setup_docker
bin/docker server

Go to http://localhost:3000

Log in as [email protected] and password password.

Go to the Judgement interface: http://localhost:3000/books/1/judge and click the buttons.

To make the code work, you need to revert the change that I made to work around thigns!

Let me know and I am happy to pair.

@epugh
Copy link

epugh commented Jan 7, 2025

i also think I need to work towards getting rid of rails-jquery, but I am half on sprockets and half on importmaps, and can't quite figure out how to get to propshaft and get rid of sprockets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants