julienbourdeau / debugbar

Powerful devtools for Ruby on Rails. Inspired by the Laravel Debugbar.
https://debugbar.dev
MIT License
479 stars 7 forks source link

Breaks jQuery for versions >=0.3.2 #39

Open fynsta opened 2 months ago

fynsta commented 2 months ago

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 commented 1 month ago

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.

fynsta commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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