Swiper: Importing v4.0.0 into an ES6 module breaks the JS build on IE11

Created on 10 Oct 2017  路  3Comments  路  Source: nolimits4web/swiper

  • [x] bug

  • Swiper Version: V4.0.0

  • Platform/Target and Browser Versions: IE11 on a Windows machine running 8.1 / 10.

What you did

import Swiper from 'swiper';

class PageProductDetail {
  constructor() {
    this.swiper = new Swiper('.swiper-container', {
        pagination: {
          el: '.swiper-pagination',
          clickable: true,
        },
        a11y: true,
      });
  }
}

export default PageProductDetail;

Expected Behavior

This simplified example above produces a working slider on every browser/machine apart from IE11 on Windows machines. The slider should work as expected on the page.

Actual Behavior

The imported Swiper library appears to break my JS bundle, breaking all JavaScript on Windows machines using IE11. I'm getting no errors in my console so I feel like something must be breaking the build. I'm using Webpack 2 and babel in this project.

Most helpful comment

Hard to understand if there are no errors. If you are using Webpack try importing UMD version instead:

import Swiper from 'swiper/dist/js/swiper.js`;

All 3 comments

Hard to understand if there are no errors. If you are using Webpack try importing UMD version instead:

import Swiper from 'swiper/dist/js/swiper.js`;

@nolimits4web Thanks for your time, this seems to have fixed the issue 馃憤 馃檶

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RyanGosden picture RyanGosden  路  3Comments

nicolebo picture nicolebo  路  3Comments

leone510es picture leone510es  路  3Comments

Joshanity17 picture Joshanity17  路  3Comments

Uriziel01 picture Uriziel01  路  3Comments