-
Notifications
You must be signed in to change notification settings - Fork 256
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
7.22.0 broke Javascript for me: Uncaught ReferenceError: bootstrap is not defined #2612
Comments
OK, interesting, I tried to reproduce on a fresh blank blacklight app following quickstart. It initially did not reproduce. Trying to compare to see what is differnet, I saw that my app had in it's sprockets.application.js:
But the quickstart empty blacklight app had just:
Changing the quickstart empty app to Indeed, in my own app, it APPEARS to work again in BL 7.22.0 if I change That is, I don't understand what the difference is; or where I would have gotten The boostrap readme suggests that:
Why would I no longer be able to use Curious if anyone has any clues here. It still seems regrettable that a minor BL release had this regression. Especially if |
I think bootstrap-sprockets is from the bootstrap-sass gem. https://github.com/twbs/bootstrap-sass This gem is for Bootstrap 3. I don't know how or why you would be using that with any 7.x version of Blacklight. |
@jcoyne, Thanks, sorry, I should have been more clear and included a link to what I discovered. The Bootstrap 4.6.1 README says:
The current master branch of the the bootstrap gem for bootstrap 5 has the exact same language. I do not have a So the The only thing that is still mysterious to me is why the (bootstrap-documented) |
Could be that #2575 is causing a problem for you. Seems odd that the bootstrap constant isn't exposed though. Are you using babel? |
I'm looking at the bootstrap.js src vs the bootstrap-sprockets.js src, and... I don't think the latter creates the bootstrap Did we ever actually include bootstrap-sprockets in the generated app? |
if you swap that implementation in for the modal show function, you can see the console log change back and forth when you require |
Docs in the wiki, as another possible place to address the issue: https://github.com/projectblacklight/blacklight/wiki/Using-Sprockets-to-compile-javascript-assets |
I am not using babel, just ordinary sprockets. I guess we could just document that if using sprockets it's incompatible with I wish I understand what was going on or why Blacklight 7.22 made a difference. Perhaps it's a bug in sprockets, as the bootstrap gem README suggests they should be semantically interchangeable when but clearly they are not. I wish I understood it enough to report it to sprockets if so. This Rails JS stuff is such a headache these days. |
We have been testing using |
Here's the diff between 7.21.0 and 7.22.0: v7.21.0...v7.22.0 If you scroll down to the diff for |
It looks to me like the bug here is 1fd592c#diff-433d29062dc674b3503c5f4dac5869c2b40ced2ac97576669a3287dba99f0861R444-R457 It's looking for |
I went looking through the history, and it looks like between Blacklight 6 and 7 we:
bootstrap-sprockets 4.x injects its classes directly onto I don't see that Blacklight's ever generated or recommended applications use |
Note that #2638 that closes this issue closes it by not trying to set up modals at all if bootstrap isn't defined -- for me I think the issue is that for whatever, reason starting with Blacklight 7.22.0, if loading bootstrap via sprockets, you can no longer do |
Upgrading from Blacklight 7.21.0 to 7.22.0 broke some javascript for me. Specifically the facet "more" link. After upgrade to 7.22.0, clicking on facet "more" link does nothing, and has this JS error in console:
Of course, I do not expect breakages on a minor version update.
Rails 6.1.4.4
I still include Blacklight js, as well as bootstrap, via sprockets. In my sprockets application.js, I have:
I am using bootstrap-4.6.1 via the ruby gem.
I wonder if this regression is only for sprockets users like me, is maybe why other developers didn't notice? Or is it related to being a bootstrap 4 user, and updates for bootstrap 5?
I'm curious how this regression escaped CI though; does CI not test with sprockets and/or bootstrap 4 anymore?
If I have a chance I'll try to investigate/debug more, but for now just establishing the bug report.
The text was updated successfully, but these errors were encountered: