The error message is telling you that object doesn't have an assign
function
. assign
is a function
which apparently is not supported in the browser you are speaking about, so you need to polyfill it. A good example is:
if (!Object.assign) {
Object.defineProperty(Object, 'assign', {
enumerable: false,
configurable: true,
writable: true,
value: function(target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('Cannot convert first argument to object');
}
var to = Object(target);
for (var i = 1; i < arguments.length; i++) {
var nextSource = arguments[i];
if (nextSource === undefined || nextSource === null) {
continue;
}
nextSource = Object(nextSource);
var keysArray = Object.keys(Object(nextSource));
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) {
to[nextKey] = nextSource[nextKey];
}
}
}
return to;
}
});
}
which can be found here: https://gist.github.com/spiralx/68cf40d7010d829340cb
However, even though this will fix the problem you were complaining about, it is highly probable that other problems will occur as well. You might need to polyfill some other stuff as well, you might want to take a look into BabelJS in order to achieve this.