Java script slider not working after npm run build

38 views Asked by At

Recently I have finished course project. I ve been working with others and now I decided to upload repository to my github. While opening site with npm run dev everything runs great, but while going with npm run build and going to github pages one of the sliders does not work and the error code I get on the website is

Uncaught ReferenceError: Swiper2 is not defined at HTMLDocument. (review-slider.js:3:17)

Link to the website: https://m3riadoc.github.io/simply_chocolate_project/

Link to github files: https://github.com/m3riadoc/simply_chocolate_project

I can't really find a reason while build side does not load this specific script.

What I tried was to link script differently, but it did not work as well.

Please be understanding as this one was my first "serious" project. Right now I am still more into HTML/CSS than JS, while still studying.

1

There are 1 answers

0
babincevm On

It looks like you don't have Swiper library imported. You may try to add cdn link (you can find it on official site in Get Started section)