debugbar
debugbar copied to clipboard
Breaks jQuery for versions >=0.3.2
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.
I'm looking at the diff and I don't get how 0.3.1 could work but the later versions 🤔 https://github.com/julienbourdeau/debugbar/compare/63d99c68bcd935f7b45cbba8abcac91301c2e223...6df7e2ebfda55b529f59e22e36bafdfc9adbc945
I'm assuming you don't get any error in the console and you ran assets:precompile.
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.
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!
@erwin No sorry, we just rolled back to 0.3.1. and are running that one for now.
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: https://github.com/o19s/quepid/commit/d1a002f7c2af425403a29545834cc801114732c9#diff-8fa62161b01787efd56863c19b7e712a949073dc606415d6d8cfe319ecc689ecR61
I'll try to setup o19s/quepid to see if I figure out the jquery issue
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.
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.
I think on the latest 0.4.3 of debug var this issue has been resolved! Just tested it with Quepid.
Excellent news! No idea why or how tho 😳
Sadly I don't work at my previous workplace anymore, so I cannot check this on our side. But if it's confirmed, we can close this issue of course!