TWITTER - 2015 - Uncaught TypeError: Cannot set property '[object Array]' of undefined widgets.js:1


#1

Uncaught TypeError: Cannot set property ‘[object Array]’ of undefined
widgets.js:1

AS per using the exact twitter widget directly from your site, its broken.
this error occurs in FF, CH, IE, iPod, iPad, and so on.

I am a developer, this is a problem with widgets.js
I have tested this on a blank page with nothing other than the embedded widget you offer.
is broken.


#2

I have the same error on my two other pages.

The widget stopped working a few days ago. Before that everything was working ok.


#3

When does this error occur? On initialization?

Also, if you could share a url to a page where the problem is occurring (even if the page is no longer using widgets.js), that’d be a huge help.


#4

any way to send a private reply?


#5

Ya know, I’m not sure. I think I may know what’s causing your problem though. Can you load the page that’s exhibiting the issue, open up the JavaScript console, enter ‘Array.prototype.reduce’, and let me know what the output is? My hunch is that your page is loading an old version of prototype.js which overrides Array.prototype.reduce with an implementation that is not ES5 compatible. See this thread for more details.


#6

I have enter Array.prototype.reduce on JavaScript console

In response I got:
framework.pack.js:361 function (){return this.length>1?this:this[0]
}

what does it mean ? How can I fix it ?

I have added to my page
< script src=“https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js”>
But it doesn’t help

I have check my time-table

Tweety @grzegorzjastrz

on both and it doesn’t work:

Embedded Timeline with Prototype 1.6.0.2:
http://jsfiddle.net/qpbbzhyo/7

Embedded Timeline with Prototype 1.7.2.0:
http://jsfiddle.net/2zrkLcq3/8


#7

So that implementation of Array.prototype.reduce is not ES5 compatible and that breaks expectations widgets.js has. To fix the problem, you’ll need to figure out why prototype.js is getting loaded and upgrade it to a newer version. Based on your output, it seems prototype.js@1.6 is getting bundled into framework.pack.js.


#8