opencart / opencart

A free shopping cart system. OpenCart is an open source PHP-based online e-commerce solution.
https://www.opencart.com/
Other
7.42k stars 4.83k forks source link

Carousel JS: Cannot read properties of null (reading 'classList') in module/banner.twig #10371

Closed cgcmart closed 2 years ago

cgcmart commented 2 years ago

https://github.com/opencart/opencart/blob/061d0b286b6476a0fd49a21a4dec4c909c468472/upload/extension/opencart/catalog/view/template/module/banner.twig#L33

Uncaught TypeError: Cannot read properties of null (reading 'classList') at st._setActiveIndicatorElement (carousel.js:364:23) activeIndicator.classList.remove(CLASS_NAME_ACTIVE) at st._slide (carousel.js:435:10) this._setActiveIndicatorElement(nextElement) at st.next (carousel.js:142:10) this._slide(ORDER_NEXT) at st.nextWhenVisible (carousel.js:149:12) this.next()

fenchu commented 7 months ago

I got this error when it turned out by was missing a carousell caption button: <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="3" aria-label="Slide 4"></button> when I was missing ` data-bs-slide-to="2", so when it come to this slide everything hanged with the above error.