Topic: Uncaught ReferenceError: PhotoSwipe is not defined
Hello guys. I have an error when trying to open lightbox image. Console always throws this.
Uncaught ReferenceError: PhotoSwipe is not defined at openPhotoSwipe (mdb.js:25884) at HTMLDivElement.onThumbnailsClick (mdb.js:25793)
// Pass data to PhotoSwipe and initialize it gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); gallery.init();Im including my JS files at the end of page. Do you know any solution to make it working?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Open
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.5.10
- Device: PC
- Browser: Chrome
- OS: Win 10
- Provided sample code: No
- Provided link: No
Bartłomiej Malanowski staff pro premium commented 6 years ago
Could you please show us more of your code? I recommend you to use our MDB Snippets to do that. You can find that feature here: https://mdbootstrap.com/snippetsUngr pro commented 6 years ago
I have just copied lightbox 'Gallery with margins' code and pasted it onto my template. See https://mdbootstrap.com/snippets/jquery/ungr/36251Bartłomiej Malanowski staff pro premium commented 6 years ago
As I can see, everything is working well in your snippetUngr pro commented 6 years ago
Seems like the only solution for now is to add another Photoswipe vianpm i photoswipe
and addPhotoSwipe: 'photoswipe', PhotoSwipeUI_Default: 'photoswipe/src/js/ui/photoswipe-ui-default.js'
variables in webpack.