Skip to content
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

IE11 (not Edge) and ES6 #9

Open
richgcook opened this issue Dec 15, 2017 · 6 comments
Open

IE11 (not Edge) and ES6 #9

richgcook opened this issue Dec 15, 2017 · 6 comments

Comments

@richgcook
Copy link

Can I just check this won't work on IE11 because of ES6, right?

@MikeMcChillin
Copy link

I was able to get it working on IE11 using a combination of the following.

Adding an alias to the minified version in my webpack config:

aliases: {
      'marquee': 'marquee3000/marquee3k.min.js'
    }

And installing and loading babel-polyfill (https://babeljs.io/docs/usage/polyfill/) before importing and initializing Marquee3k:

import 'babel-polyfill';
import Marquee3k from 'marquee';

@chrisstoneking
Copy link

Thanks Mike - I had to make it work on IE11, and your solution was perfect!

@StudioVDS
Copy link

StudioVDS commented Jan 20, 2018

Hi there, I'm also trying to get this to work on IE11. I'm not aware of using ES6. And don't understand the solution mentioned above.

I get a Syntax Error: File: script.js, Line: 7495, Column: 3

I use this plugin on a Drupal 8 website, with jQuery. Can anyone help me with solving this problem?

@leptest
Copy link

leptest commented Jul 10, 2018

Ran into this issue too. Following the instructions from @MikeMcChillin worked.

But would like a real fix please @ezekielaquino 😄.

@fariskas
Copy link

fariskas commented Oct 16, 2018

anyone with an marquee3000.js just thats not in ES6? (does this make sense?)
the current one doesnt work after i tried transpiling(?) and im not sure how to make that work

@Jakob-Maudience
Copy link

I've been using the minified version because of errors with uglify.js (even though I'm transpiling with babel, I still get an error due to es6 syntax).

It seems like the error in Marquee3000 was caused by IE not supporting the Array.from function. To fix the IE issue, instead of using @babel/polyfill (which added a lot of bloat to my code) I instead added the Array.from polyfill from polyfill.io

Here's the script tag you'll need to add before your Marquee scripts -

<script src="https://cdn.polyfill.io/v2/polyfill.js?features=Array.from"></script>

If you're not familiar with polyfill.io, it's a cdn which detects what browser your'e using and determines whether your browser needs a polyfill or not. if you look at https://cdn.polyfill.io/v2/polyfill.js?features=Array.from in Chrome or Firefox, you'll see an almost empty file. If you look at the same file in an older browser like IE, you will see that you are served the polyfill script.

The downside is that your site will have to make an external request to polyfill.io just for the sake of supporting IE which you may not like. You might want to write a more clever solution with actual feature detection instead, but using polyfill.io this is a pretty easy alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants