larabel
1 year ago
186
3
Mix

Correct way to install PhotoSwipe gallery ?

Posted 1 year ago by larabel

Hello,

I try to install PhotoSwipe gallery but had JS errors on html page -

"Uncaught ReferenceError: PhotoSwipeUI_Default is not defined"

As I understand it's because not all JS includes correctly.

Can anybody explain how to correctly install PhotoSwipe? It's possible with Mix?

PS: I try to install in this way:

yarn add photoswipe

in bottom of resources/assets/js/bootstrap.js I add

window.PhotoSwipe = require('photoswipe');

npm run dev

Please sign in or create an account to participate in this conversation.