swiper

Open full view…

Swiper fails to load on iOS 10

samwise1
Fri, 05 Oct 2018 12:58:07 GMT

We have an issue with the swiper library, its chucking an error in iOS 10 - `ReferenceError: Can't find variable: Dom7`. Seems to work everywhere else without a problem.. I found some posts on the internet about this, but nothing with a conclusive answer. I've tried the following 2 things 1. Added a `require 'dom7'` above the swiper require (https://segmentfault.com/q/1010000015236204/a-1020000015237486 2. Added `"ios >= 6"` to the browserlist in package.json (https://github.com/babel/babel-preset-env/issues/119) Neither of them fixed the issue We are too far deep into the project, and we urgently need to find a fix for this issue. Otherwise we'd have to go and rewrite a ton of carousels on the website.. Does anyone know of an easy fix?

samwise1
Fri, 05 Oct 2018 16:12:39 GMT

Turns out, it was due to using `require('swiper');` I switched it to `require('swiper/dist/js/swiper.js');`, and it started to work again..