jsanahuja / InstagramFeed

Vanilla JavaScript Instagram Feed without access token. Not using the Instagram API
MIT License
318 stars 128 forks source link

"Object doesn't support property or method 'assign'" From Internet Explorer #41

Closed matthewtdemery closed 3 years ago

matthewtdemery commented 4 years ago

....it's 6AM and I need sleep. The script works perfectly in Firefox, Opera, and Chrome. But IE11? Nope! I don't blame you or your coding. I blame those knucks down in Redmond who refuse to work together with the rest of us. Productivity never trumps profit. goodnight :)

jsanahuja commented 4 years ago

I don't have Internet Explorer so feel free to send a pull request with the changes to get it working for IE 11

reynoldspaul commented 3 years ago

@matthewtdemery found a solution - need a polyfill for IE https://stackoverflow.com/a/39021339/11770149

if (typeof Object.assign != 'function') {
  Object.assign = function(target) {
    'use strict';
    if (target == null) {
      throw new TypeError('Cannot convert undefined or null to object');
    }

    target = Object(target);
    for (var index = 1; index < arguments.length; index++) {
      var source = arguments[index];
      if (source != null) {
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
    }
    return target;
  };
}

Fixes it for me on IE

jsanahuja commented 3 years ago

Should be fixed as of the 2.0.2 release.

Thanks @RaiserWeb