Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Not working in IE11 #34

Open
PetarMG-BG opened this issue Jan 20, 2020 · 3 comments
Open

Not working in IE11 #34

PetarMG-BG opened this issue Jan 20, 2020 · 3 comments

Comments

@PetarMG-BG
Copy link

Hello,
the lib is perfect but it's not working on IE11, because of Object.assign.
I was trying to add the polyfill but still not working trowing the following error:

'Symbol' is undefined

Can somebody help?

@rohithb
Copy link
Member

rohithb commented Jan 21, 2020

I don't have a windows machine to check the compatibility on IE11.
I think you could try rebuilding the the source code following this issue.
Try building the package by adding the following in the babel configuration defined in package.json
as mentioned in https://babeljs.io/docs/en/babel-preset-env

{
  "targets": {
    "ie": "11"
  }
}

@PetarMG-BG
Copy link
Author

PetarMG-BG commented Jan 21, 2020

I don't have a windows machine to check the compatibility on IE11.
I think you could try rebuilding the the source code following this issue.
Try building the package by adding the following in the babel configuration defined in package.json
as mentioned in https://babeljs.io/docs/en/babel-preset-env

{
  "targets": {
    "ie": "11"
  }
}

Thanks for your response.
I'm not using a builder, I'm using this in the browser and just I get the js file.
When I add the following polyfill:
`if (typeof Object.assign !== 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
value: function assign(target, varArgs) { // .length of function is 2
'use strict';
if (target === null || target === undefined) {
throw new TypeError('Cannot convert undefined or null to object');
}

  var to = Object(target);

  for (var index = 1; index < arguments.length; index++) {
    var nextSource = arguments[index];

    if (nextSource !== null && nextSource !== undefined) { 
      for (var nextKey in nextSource) {
        // Avoid bugs when hasOwnProperty is shadowed
        if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
          to[nextKey] = nextSource[nextKey];
        }
      }
    }
  }
  return to;
},
writable: true,
configurable: true

});
}`
From:

The Object.assgin is nomore an error, but it trows an error about undefined Symbol

@PetarMG-BG
Copy link
Author

Can somebody help with this?

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

No branches or pull requests

2 participants