We have the same problem. With programmatically implemented swiperjs slides, these were displayed corrupted due to the breakpoints replace function. The error can be temporarily fixed by commenting out the line i.breakpoints = JSON.parse… in frontend_blocks.js. is commented out.
if (i.breakpoints) {
// i.breakpoints = JSON.parse(i.breakpoints.replace(/\\/g, ""));
}
Since we migrated to data-swiper JSON object, please make sure that your json object contains breakpoints key. See image below, let me know if this doesnt make sense. And may share you html or for the swiper, in particular where you have config data attributes.
https://imgur.com/yF6dVCw
Thanks @digitalapps for your quick reply.
We already used data-swiper JSON objects and this is our code in our twig template, that used to work before 1.2.15
<div class="swiper-container swiper swiper-initialized swiper-horizontal swiper-autoheight swiper-backface-hidden gallery-{{ album_id }} gallery" data-debug="true" data-swiper='{"slidesPerView":"1","navigation":false,"pagination":{"type":"bullets","clickable":true},"delay":3000,"speed":500,"loop":false,"direction":"horizontal","slidesOffsetBefore":0,"slidesOffsetAfter":0,"autoHeight":true,"spaceBetween":20,"releaseOnEdges":false,"effect":"slide","breakpoints":{"768":{"slidesPerView":2},"1280":{"slidesPerView":3},"1440":{"slidesPerView":{{spv}}}}}'>
Even if we add \ before the ” as shown in your example, the slides and breakpoints will not be shown correctly.
Update pushed that should resolve the issue on custom swipers. please update and let me know how it goes.
Updatet to 1.2.16 but Error isn’t resolved. Console shows
frontend_block.js?ver=1.2.16:1 JS Error:
(anonym) @ frontend_block.js?ver=1.2.16:1
frontend_block.js?ver=1.2.16:1 TypeError: i.breakpoints.includes is not a function
at e.init_options (frontend_block.js?ver=1.2.16:1:732)
at e.init (frontend_block.js?ver=1.2.16:1:66)
at frontend_block.js?ver=1.2.16:1:2186
We have more than one wp-slider per page implemented, maybe that’s a hint?
-
This reply was modified 1 year, 1 month ago by
chris.
Please update, I tried running a custom config on my end, and it worked!
Interested to hear if it works on your end.
Updated to 1.2.17: the error has gone, custom sliders work.
Thank you for the fix!
It’s working great now. Thank you so much for your time.