question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Object doesn't support property or method 'assign'

See original GitHub issue

IE error thrown.

in this function

while (sources.length > 0) {
   var source = sources.shift();
   if (isObject(source)) {
     for (var key in source) {
       if (isObject(source[key])) {
         target[key] = mergeDeep(target[key], source[key]);
       } else {
         Object.assign(target, defineProperty({}, key, source[key]));
       }
     }
   }
 }
 return target;
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
artemskycommented, Nov 10, 2017

@riksnelders This code generated by webpack with target of ‘ES5’ for this part of code https://github.com/artemsky/vue-snotify/blob/master/src/util.js#L17

I’ll try to do something with that in next release (soon)

1reaction
grantcarthewcommented, Nov 10, 2017

Try this pollyfill from MDN:

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) { // TypeError if undefined or null
        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) { // Skip over if undefined or null
          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
  });
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Error: Object doesn't support property or method 'assign'
These error usually occurs when some html element id has the same id as some variable in the JavaScript function. After changing the...
Read more >
Solved: Object doesn't support property or method 'assign'
Solved: Object doesn't support property or method 'assign'. Object.assign() method is not supported in IE, but there is a polyfill available
Read more >
IE11 Object doesn't support property or method 'assign' #639
I'm having an issue with IE11 while using core-js@3 with Webpack. Getting Object doesn't support property or method 'assign' . Seems that Object ......
Read more >
JS: Error "Object doesn't support property or method 'assign ...
On IE the map doesn't render and the following error appears in the console: "Object doesn't support property or method 'assign'".
Read more >
FIX: "SCRIPT438: Object doesn't support property or method ...
Fixes an issue in which you receive an error message when you visit a .NET Framework 3.5-based ASP.NET webpage in Internet Explorer 10....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found