When initializing Swiper JS within a Drupal behavior, a "Uncaught RangeError: Invalid string length" error occurs. This error seems to originate from within the Swiper library itself, specifically when creating a new Swiper instance using new Swiper().
1. Install and enable Swiper Formatter (or your module/theme).
2. In Swiper template settings choose remote library
3. Load a page where the Swiper field is displayed.
4. Observe the browser console for the "Uncaught RangeError: Invalid string length" error.
The problem is definitely in cont swiperSettings.
Review and correct the swiperSettings object: Ensure all properties have valid values and data types according to the Swiper JS API documentation.
Reminder: We are using swiper@11.1.0 version
I've made a couple tests and put a properly filled up swiperSettings and error disappear.
Active
2.0
Code