trvswgnr / bs5-lightbox

A pure JS lightbox gallery plugin for Bootstrap 5 based on the Modal and Carousel components
https://trvswgnr.github.io/bs5-lightbox/
MIT License
125 stars 28 forks source link

Error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'id') #61

Open lpranger opened 1 year ago

lpranger commented 1 year ago

I am running Rails 7 with importmap to the cdn link.

Its being load in the application.js within the initial load in the view mode it errors and does NOT work and needs the page to refresh to work. When you click into edit mode it works but clicking back to view mode it errors also with the the error mentioned in the subject line. Any idea?

Thanks

Larry

trvswgnr commented 1 year ago

hi @lpranger could you provide some more detail surrounding the issue and maybe a way i could try to recreate it? without context it's hard to say what's going wrong here. thanks!

lpranger commented 1 year ago

Yes, right now we are loading the js in the footer and on the face of it all works but still getting errors. Running Rails 7 with turbo-rails where in lies the problem (I believe).

Here's a url to look at https://www.makernotebook.org/portfolios/cardboard-ferris-wheel-marble-run-1681348251

click on a video or one the various galleries. All works visually but I am getting this error when clicking on a lightbox item.

Uncaught TypeError: Cannot read properties of undefined (reading 'Modal') at index.js:10:7 at index.bundle.min.js:5:8147 cardboard-ferris-wheel-marble-run-1681348251:1 Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

Thanks for the response!