Swiperjs não funciona dentro do modal

$(document).ready(function(){
    $(".modal").on('show.bs.modal', function() {
        setTimeout(function() {
            var swiper3 = new Swiper('.swiper-container', {
                pagination: '.swiper-pagination',
                nextButton: '.swiper-button-next',
                prevButton: '.swiper-button-prev',
                slidesPerView: 1,
                spaceBetween: 30,
                loop: true,
                effect: 'fade'
            });
        }, 500);
    });
});
Clever Corncrake