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 ReferenceError: 'Promise' is undefined #82

Open
isherwood opened this issue May 4, 2017 · 6 comments
Open

IE11 ReferenceError: 'Promise' is undefined #82

isherwood opened this issue May 4, 2017 · 6 comments

Comments

@isherwood
Copy link

isherwood commented May 4, 2017

This error occurs for me in IE11.

ReferenceError: 'Promise' is undefined
at create (https://dev7.atomiclearning.com/static/js_apps/main/node_modules/angular-flickity/dist/angular-flickity.js:161:14)
at Anonymous function (https://dev7.atomiclearning.com/static/js_apps/main/node_modules/angular-flickity/dist/angular-flickity.js:948:14)
...

Research indicates that the module might rely on Promise, which is not supported by IE11. Was it intended that a polyfill be used? Why wasn't $q used instead?

@isherwood
Copy link
Author

I've added a polyfill for Promises:

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

The page loads extremely slowly, though, and the slide animation is also very slow and jerky. Possibly related is the fact that the demos don't work in IE.

@benjamincharity
Copy link
Owner

Hey @isherwood, when this was being built IE was not a target browser. The core Flickity library does support IE10+ so IE support would be a good addition.

I've recently started a new role so my time is extremely tight right now so I can't say if/when I could refactor this. :/ More than open to PRs though if the polyfill isn't cutting it for you.

@isherwood
Copy link
Author

isherwood commented Jun 2, 2017

I completely understand. Not to derail anyone, but I ended up writing a simple directive that is working well in IE11:

        .directive('myFlickity', function ($timeout) {
            return {
                restrict: 'A',
                link: function (scope, element, attrs) {

                    // wait for the ngRepeat stuff to get set up
                    $timeout(function () {
                        // register DOM listeners and update the DOM
                        var slider = element.flickity(scope.$eval(attrs.alFlickity));

                         // grab the Flickity data object for later use
                        var sliderData = slider.data('flickity');
                    });
                }
            };

I was able to improve performance by simplifying my markup structure. IE is still much slower than other browsers, but it's tolerable. IE is dying anyway.

@adrienlamotte
Copy link

+1 IE 10+ support would be great. I'll use the polyfill for now thanks :)

@akhlopyk
Copy link

I had an issue with IE11 -> 'Promise' is undefined
Just used $q instead.

Worked for me

@parmarsanjayCLS
Copy link

parmarsanjayCLS commented Jan 23, 2019

I'm having the same issue. @akhlopyk. Can you please how you ended up fixing it? Thanks for your help.

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

No branches or pull requests

5 participants