New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing v4.0.0 into an ES6 module breaks the JS build on IE11 #2237

Closed
chansecampbell opened this Issue Oct 10, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@chansecampbell
Copy link

chansecampbell commented Oct 10, 2017

  • 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.

@nolimits4web

This comment has been minimized.

Copy link
Owner

nolimits4web commented Oct 11, 2017

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`;
@chansecampbell

This comment has been minimized.

Copy link
Author

chansecampbell commented Oct 11, 2017

@nolimits4web Thanks for your time, this seems to have fixed the issue 👍 🙌

@lock

This comment has been minimized.

Copy link

lock bot commented Jun 25, 2018

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.

@lock lock bot added the outdated label Jun 25, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Jun 25, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.