woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.92k stars 1.7k forks source link

Maximum call stack exceeded when adding a slide #1656

Open differentstudios opened 7 years ago

differentstudios commented 7 years ago

I have FlexSlider 2.5 installed in my shopify theme and whenever I try to add a slide I get this error

Uncaught RangeError: Maximum call stack size exceeded

Here's the code I use to add a slide:

$('.product_slider').data('flexslider').addSlide($(li_html));

Here's the code I instantiate the flexslider with

  $('.product_slider').flexslider({
    startAt: parseInt($('.featured_image', $(this)).data('index'), 10),
    touch: true,
    pauseOnHover: true,
    controlNav: "thumbnails",
    directionNav: false,
    {% if settings.product_slideshow_animation == 'none' or settings.product_slideshow_animation == 'zoom' %}
    slideshow: false,
    {% else %}
    animation: "{{ settings.product_slideshow_animation }}",
    {% endif %}
    slideshowSpeed: {% if settings.slideshow_speed != blank %}{{ settings.slideshow_speed }}{% else %}10{% endif %}*1000,
    animationSpeed: 1
  });

I am not sure what's causing this error when adding a slide.

Edit: I also get the same error when I am trying to delete the file.

jeffikus commented 6 years ago

How many slides are you trying to add?

jrealpe commented 6 years ago

I have the same problem, add 1 or >1 slides and in any case throw the error. I managed to detect the problem and that is when I add this line { controlNav: "thumbnails", } in flexslider init. I need to use 'controlnav' with 'thumbnails' too but I do not know how to solve the problem.

MateoLa commented 6 years ago

I also have this problem. Is like jrealpe said, deleting { controlNav: "thumbnails" } from flexslider the error disapear.

mixian commented 6 years ago

I also have this problem, but i need the thumbnails for controlnav. Has anyone solved the problem?

kculmback commented 5 years ago

Having this problem as well. slider.addSlide() calls slider.update(), which calls methods.controlNav.update(), which calls slider.update(), which calls methods.controlNav.update(), etc...

MateiSorin commented 3 years ago

I also have this problem. Has anyone solved the problem?