Cannot read properties of undefined (reading ‘firstChild’) using photoswipe in product page

I was doing it wrong. Data has to go into javascript, and orignal html should not be changed <div class=”pswp” tabindex=”-1″ role=”dialog” aria-hidden=”true”> <div class=”pswp__bg”></div> <div class=”pswp__scroll-wrap”> <!– Container that holds slides. –> <div class=”pswp__container”> <!– don’t modify these 3 pswp__item elements, data is added later on –> <div class=”pswp__item”></div> <div class=”pswp__item”></div> </div> <!– Default … Read more