Page MenuHomePhabricator

Unable to get property 'data' of undefined or null reference File: ext.cx.interlanguagelink.js, Line: 54, Column: 4
Closed, ResolvedPublic

Description

JavaScript error in ContentTranslation scripts on enwiki. Seems to be intermittent for some users, persistent for others:

Unable to get property 'data' of undefined or null reference
File: ext.cx.interlanguagelink.js, Line: 54, Column: 4

That error is from IE. Similar TypeError seen in other browsers.

This seems to stop other user scripts and gadgets from loading.

Original description:


Hi there,

For some reason the GoogleTrans gadget is loading intermittently. Sometimes it loads (check MORE menu item to see if it has). When it does load there is no javascript error message. When it doesn't load the following javascript error message can be seen:

LOG: Exception in module-execute in module ext.cx.interlanguagelink:
TypeError: Unable to get value of the property 'data': object is null or undefinedTypeError: Unable to get value of the property 'data': object is null or undefined

I assume this is a wiki thing since the gadget was last changed two weeks ago, and has run well since then. MediaWiki hasn't been updated, according to SignPost, either.

I got a slightly better error message in the javascript:

function pageInLanguageExists(code){return $('li.interlanguage-link.interwiki-'+code).length===1;}
there is an error in the function above, I believe, and this seems to be stopping the GoogleTrans gadget from properly loading.

this only seems to be happening on the enwiki. the other wikis that run the gadget seem to be okay

Event Timeline

Endo999 raised the priority of this task from to Needs Triage.
Endo999 updated the task description. (Show Details)
Endo999 subscribed.
Aklapper renamed this task from GoogleTrans gadget loads internmittantly on enwii to GoogleTrans gadget loads intermittently on enwiki.Oct 2 2015, 9:50 AM
Aklapper set Security to None.

I cannot manage to get anything at all with Firefox 41. In which browser(s) does it sometimes load for you?

MediaWiki hasn't been updated, according to SignPost, either.

For the records, MediaWiki gets updated every week. See https://www.mediawiki.org/wiki/MediaWiki_1.27/Roadmap and https://www.mediawiki.org/wiki/MediaWiki_1.26/Roadmap

TTO renamed this task from GoogleTrans gadget loads intermittently on enwiki to Unable to get property 'data' of undefined or null reference File: ext.cx.interlanguagelink.js, Line: 54, Column: 4.Oct 2 2015, 1:23 PM
TTO triaged this task as High priority.
TTO updated the task description. (Show Details)
TTO added a subscriber: Joe.

Hmm, does this still happen? I cannot reproduce it - the GoogleTrans gadget works for me, and I do have ContentTranslation enabled. We did have some issues in this area of the code, but they should be fixed in the English Wikipedia since yesterday.

If it happens again, can you please reload the page with ?debug=true at the end of the URL and post the line at JavaScript line at which the error happens?

Thanks!

If it happens again, can you please reload the page with &debug=true at the end of the URL and post the line at JavaScript line at which the error happens?

For some reason I can't &debug=true to work. I'm abuot to leave for a bit, so I thought I'd post the console output where the problem happens... hope this helps.

Uncaught TypeError: Cannot read property 'data' of undefined

(anonymous function) @ VM3222:255
jQuery.extend.grep @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:6
getSuggestedTargetLanguages @ VM3222:254
prepareCXInterLanguageLinks @ VM3222:255
(anonymous function) @ VM3222:256jQuery.Callbacks.fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:45
jQuery.Callbacks.self.fireWith @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:46
jQuery.extend.ready @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:49
completed @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:49

load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:156

If it happens again, can you please reload the page with &debug=true at the end of the URL and post the line at JavaScript line at which the error happens?

For some reason I can't &debug=true to work. I'm abuot to leave for a bit, so I thought I'd post the console output where the problem happens... hope this helps.

My bad, it has to be ?debug=true of course.

Forgot... turning off CX does make Twinkle re-appear.

with ?debug=true

Uncaught TypeError: Cannot read property 'data' of undefined    ext.cx.interlanguagelink.js:56 

(anonymous function)    @	ext.cx.interlanguagelink.js:56
jQuery.extend.grep   @	load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=ok2tSBsQ:483
getSuggestedTargetLanguages   @	ext.cx.interlanguagelink.js:53
prepareCXInterLanguageLinks   @     ext.cx.interlanguagelink.js:114
(anonymous function)   @	ext.cx.interlanguagelink.js:150

I tried your suggestion and did

https://en.wikipedia.org/wiki/Main_Page

which did not load the gadget on Chrome 39.0.2171.71 dev-m

I then tried your suggestion with

https://en.wikipedia.org/wiki/Main_Page?debug=true

This time the GoogleTrans gadget loaded and ran. I did this twice and twice the same things happened

There probably is a timing error in loading javascript.

And with ?debug=true Firefox shows that the "$.uls is undefined" error is at ext.cx.interlanguagelink.js:56:0

I turned beta Content Translation off and then was able to get the GoogleTrans gadget in the enwiki main page, which I hadn't been able to do with Content Translation on for several days now.

I am now able to get the GoogleTrans gadget loaded onto the main enwiki page in both Chrome, Firefox and IE11 whereas I wasn't able to do this for the last several days. It doesn't seem that there is a problem now loading the GoogleTrans gadget anymore.

TTO claimed this task.

Indeed, it now works for me. I'll close this task as Resolved; please reopen if you are still experiencing this issue.