Object doesn't support 'assign' property or method

200 views
Skip to first unread message

Angelo Palumbo

unread,
Jul 9, 2020, 4:28:20 AM7/9/20
to Google Visualization API
Hi all, starting today Internet Explorer 11 returns the error "Object doesn't support 'assign' property or method" when I try to create a line chart with loader.js. Has ever happened to you?

Patrick Read

unread,
Jul 9, 2020, 5:04:47 AM7/9/20
to Google Visualization API
We are experiencing the same - all IE11 users are seeing the above error displaying any charts.

Philippe Debrabant

unread,
Jul 9, 2020, 5:15:58 AM7/9/20
to Google Visualization API

Philippe Debrabant

unread,
Jul 9, 2020, 5:47:02 AM7/9/20
to Google Visualization API
And trying to load a previous version don't work as the same "Object.assign" code is called in https://www.gstatic.com/charts/loader.js:90:18

Tedd Mason

unread,
Jul 9, 2020, 5:50:08 AM7/9/20
to Google Visualization API
Our service is also having the same issue for internet explorer since yesterday.

Takuma Hashimoto

unread,
Jul 9, 2020, 5:57:21 AM7/9/20
to Google Visualization API
We also faced the issue. So we inserted Object.assign polyfill just in front of `google.charts.load(...)` and solved this.

Tedd Mason

unread,
Jul 9, 2020, 6:01:12 AM7/9/20
to google-visua...@googlegroups.com
Hi Takuma, thank you! Polyfill indeed sorts it, I'm wondering though if google will fix this in the meantime or if I need to make the polyfill change, as by the time our change process completes they may have already solved! ha

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/66dfd096-5db1-4866-9d0a-c516ec576417n%40googlegroups.com.

Angelo Palumbo

unread,
Jul 9, 2020, 6:04:32 AM7/9/20
to Google Visualization API
Can you post the code, please?

Tedd Mason

unread,
Jul 9, 2020, 6:06:53 AM7/9/20
to Google Visualization API
Source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#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
  });
}

Angelo Palumbo

unread,
Jul 9, 2020, 6:12:32 AM7/9/20
to Google Visualization API
Works, thanks.

Dan Espich

unread,
Jul 9, 2020, 10:48:32 AM7/9/20
to Google Visualization API
This worked for me as well, I inserted this function before me google.charts.load line. It  evidently rewrites the IE object assign function

        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
            });
        }

Doug Sims

unread,
Jul 9, 2020, 12:16:50 PM7/9/20
to Google Visualization API
Same issue here - Same assignPollyfill fix applied - thanks
Reply all
Reply to author
Forward
0 new messages