You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: form_observer Stimulus controller throws "jQuery is not defined" (unsaved-changes warning never runs) #3702
app/javascript/spotlight/admin/form_observer.js is still written as a jQuery plugin, but jQuery is no longer bundled with Blacklight 8 / Spotlight 5. The controller therefore throws on every page that loads it, and the "you have unsaved changes" beforeunload guard never takes effect.
What happens
Browsing the admin screens as an exhibit admin, the console shows:
Uncaught ReferenceError: jQuery is not defined
at .../assets/spotlight/admin/form_observer-<digest>.js:67
Why
The file wraps its plugin in an IIFE that is invoked with jQuery, and connect() then uses $:
;(function($,_){
...
})(jQuery)// ← ReferenceError: jQuery is not definedexportdefaultclass{connect(){varserializedForm=$.SerializedForm()$(window).on("beforeunload page:before-change turbolinks:before-visit turbo:before-visit", ...)}}
Nothing else on the page defines jQuery, so the module fails at evaluation time.
Impact
Cosmetically nothing is broken — pages render fine — which is why it is easy to miss. But the feature this controller exists for (warning a curator who navigates away from a form with unsaved changes) is silently inoperative.
Reproduced on the generated test app with both importmap and the default asset setup.
Also noticed nearby
On /:exhibit_id/appearance/edit, the masthead cropper raises Invalid LatLng object: (-5, NaN) from Leaflet when the exhibit's masthead is an external IIIF image. Filed here only as a note — happy to open a separate issue if useful.
Activity
jcoyne commentedon Aug 30, 2026
Maybe #3678 should be merged now?