Как исправить ошибку карусели django+bootstrap

После первой прокрутки карусель перестает работать и возвращает ошибку, но я не понимаю этого

мой html:

<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                <div class="carousel-indicators">
                    {% for photo in product.photo_set.all %}
                    {% with forloop.counter0 as i %}
                        <button type="button" data-target="#carouselExampleIndicators" data-slide-to="{{i}}"{% if i is 0 %}class="active" aria-current="true"{% endif %}></button>
                    {% endwith %}
                    {% endfor %}
                </div>
                <div class="carousel-inner">
                    {% for photo in product.photo_set.all %}
                    {% with forloop.counter0 as i %}
                            <div class="carousel-item {% if i is 0 %}active{% endif %}">
                                <img class="d-block w-100 image-source rounded" src={{photo.image.url}} style='height: 30rem;'>
                            </div>
                    {% endwith %}
                    {% endfor %}
                </div>
                <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="visually-hidden">Previous</span>
                </button>
                <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">
                   <span class="carousel-control-next-icon" aria-hidden="true"></span>
                   <span class="visually-hidden">Next</span>
                </button>
            </div> 

и ошибка в хроме:

Uncaught TypeError: Cannot read properties of null (reading 'classList')
    at at._setActiveIndicatorElement (carousel.js:364:23)
    at at._slide (carousel.js:435:10)
    at at.prev (carousel.js:154:10)
    at Function.carouselInterface (carousel.js:526:12)
    at HTMLButtonElement.dataApiClickHandler (carousel.js:556:14)
    at HTMLDocument.s (event-handler.js:119:21)

да (извините), за компьютером я обезьяна с гранатой

Вернуться на верх