Page MenuHomePhabricator

Blank page on Special:ContentTranslation
Closed, ResolvedPublic

Description

We are getting reports of having blank page when visiting Special:ContentTranslation. Only the personal bar at the top is shown. It is likely that the reason is a JavaScript error and we need the error details to fix it.

Event Timeline

Nikerabbit raised the priority of this task from to Needs Triage.
Nikerabbit updated the task description. (Show Details)
Nikerabbit added a project: ContentTranslation.
Nikerabbit subscribed.

Urdu Wikipedia users are getting this error.

Browsers: Chrome, Firefox
Error shown in console: Use of "addOnloadHook" is deprecated. Use jQuery instead.
load.php?debug=false&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=GcaPrDtg:156 console.trace()mw.log.log.warn @ load.php?debug=false&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=GcaPrDtg:156

@MuhammadShuaib, can you please:

Also, can you please try doing this from a different account?

Uncaught TypeError: Cannot read property 'pluginModules' of null
Uncaught TypeError: Cannot read property 'ltr' of null
Uncaught TypeError: Cannot read property 'eventlogging' of null
Uncaught TypeError: Cannot set property 'overlay' of undefined

I'm getting this consistently in my main window, when logged in, and using a specific script
The error I am getting is TypeError: document.getElementById(...) is null (Firefox) or TypeError: Cannot read property 'firstChild' of null (Chrome) (screenshots: 1, 2).
I've reported the error at https://en.wikipedia.org/wiki/User_talk:Ais523/highlightmyname2.js#TypeError_at_special_page - but I'm not sure if it's a problem at the script end, or the specialpage end. HTH.

@Amire80,

For me,
Browser: Google Chrome
OS: Linux

Error: mediaWiki.Api instance needs to be provided Error: mediaWiki.Api instance needs to be provided
    at new WbApiRepoApi (https://ur.wikipedia.org/static/1.26wmf9/extensions/Wikidata/vendor/wikibase/javascript-api/src/RepoApi.js:30:9)
    at Object.<anonymous> (https://meta.wikimedia.org/w/index.php?title=User%3A%D7%A2%D7%A8%D7%9F%2Fspellchecker.js&action=raw&ctype=text/javascript:33:31)
    at fire (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3148:30)
    at Object.self.fireWith [as resolveWith] (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3260:7)
    at Object.deferred.(anonymous function) [as ready] (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3350:34)
    at handlePending (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11587:14)
    at markModuleReady (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11691:8)
    at nestedAddScript (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11698:9)
    at Object.<anonymous> (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11703:9)
    at fire (https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3148:30)

I'm getting this consistently in my main window, when logged in, and using a specific script
The error I am getting is TypeError: document.getElementById(...) is null (Firefox) or TypeError: Cannot read property 'firstChild' of null (Chrome) (screenshots: 1, 2).
I've reported the error at https://en.wikipedia.org/wiki/User_talk:Ais523/highlightmyname2.js#TypeError_at_special_page - but I'm not sure if it's a problem at the script end, or the specialpage end. HTH.

That script you are using assumes the page will always have a body content and tries to access it causing js error. Definitely the script need fix.

I consistantly get the following js error at Special:CX in ur.wikipedia.org

Error: mediaWiki.Api instance needs to be provided Error: mediaWiki.Api instance needs to be provided
Stack trace:
WbApiRepoApi@https://ur.wikipedia.org/static/1.26wmf9/extensions/Wikidata/vendor/wikibase/javascript-api/src/RepoApi.js:30:1
setup/<@https://meta.wikimedia.org/w/index.php?title=User%3A%D7%A2%D7%A8%D7%9F%2Fspellchecker.js&action=raw&ctype=text/javascript:33:31
jQuery.Callbacks/fire@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3148:10
jQuery.Callbacks/self.fireWith@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3260:7
.Deferred/</deferred[tuple[0]]@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3350:5
handlePending@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11587:10
runScript/markModuleReady@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11691:8
runScript/nestedAddScript@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11698:9
runScript/nestedAddScript/<@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:11703:9
jQuery.Callbacks/fire@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3148:10
jQuery.Callbacks/self.fireWith@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:3260:7
done@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:9314:5
.send/script.onreadystatechange@https://ur.wikipedia.org/w/load.php?debug=true&lang=ur&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=uoC7Q1W%2B:9829:8

Enable CX beta feauture in urdu wikipedia, and goto https://ur.wikipedia.org/wiki/Special:ContentTranslation?to=ur&debug=1 and see browser console.

@Amire80 ,

I got the following error while visiting https://ur.wikipedia.org/wiki/Special:CXStats?debug=true

Error: mediaWiki.Api instance needs to be provided 
Error
arguments: undefined
get stack: function getter() { [native code] }
message: "mediaWiki.Api instance needs to be provided"
set stack: function setter() { [native code] }
type: undefined
__proto__: ErrorPrototype

And also Usertool bar and language popup window are displaying in LTR.

Actually when we activate this script/gadget on Urdu Wikipedia, get the blank page reported earlier here. Now we all have unchecked this gadget in prefs, and CX works fine, Thanks :)

Now we updated this above mentioned script and CX is working fine with script.

That script you are using assumes the page will always have a body content and tries to access it causing js error. Definitely the script need fix.

This might be a silly question, but why does the special page not have body content?

Actually when we activate this script/gadget on Urdu Wikipedia, get the blank page reported earlier here. Now we all have unchecked this gadget in prefs, and CX works fine, Thanks :)

@MuhammadShuaib, I suggested a fix for HotCat here, with which you should be able to use both HotCat and ContentTranslation.

That script you are using assumes the page will always have a body content and tries to access it causing js error. Definitely the script need fix.

This might be a silly question, but why does the special page not have body content?

@Legoktm, Because to accommodate the room for all the elements that are required for CX, we had to remove almost all of the usual MediaWiki UI. @Pginer-WMF probably has a deeper explanation.

This is a common reason for breaking scripts, although it's unrelated to the problem in ur.wikipedia, which @MuhammadShuaib described.

@Pginer-WMF probably has a deeper explanation.

I have an explanation about the need of not using the standard layout (especially the left sidebar) for Content Translation. Since the translation process requires to access multiple content (the source and target articles as well as translation info from language tools such as dictionaries) we wanted to make the most use of the space for the translation process. The left sidebar is not of very much use when the user is focused on the translation process.

Having said that, I'm not sure what "not have body content" means. There is definitely content in Content Translation, and if marking it technically in some way helps, I don't have anything against it.

Having said that, I'm not sure what "not have body content" means. There is definitely content in Content Translation, and if marking it technically in some way helps, I don't have anything against it.

An element with the id='content'. I occasionally consider adding id='content' to some element on Special:CX, but it won't really solve the problem, because after accessing the element the scripts usually do actions that depend on other elements inside it. Another commonly failing element is the search box (there is a search box on Special:CX, but it's completely different).

Sorry, I was asking about Special:CXStats specifically, not Special:CX. Generally, it seems like we're going to run into this issue on every wiki for most gadgets, and it seems odd for all of those to have to special case one page that is doing non-standard things...

We deployed to over 150 wikis, and we ran into it in some gadgets in some wikis. Admins everywhere have been cooperative and updated the code. These gadgets use a lot of legacy code that needs a shake-up anyway :)

Amire80 moved this task from CX6 to CX5 on the ContentTranslation board.

To be closed after the successful deployment to the last language :)

I tested this in Firefox 38.0.5 on Mac OS 10.10.3

The dropdown from the contribs item at simple: (https://simple.wikipedia.org/wiki/Special:ContentTranslation?campaign=contributionsmenu&to=en) gives me this in the Browser console:

about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
TypeError: document.getElementById(...) is null index.php:67:20
about:blank : Unable to run script because scripts are blocked internally. <unknown>
"Exception in store-localstorage-update:" load.php:177:843
"NS_ERROR_DOM_QUOTA_REACHED: Persistent storage maximum size reached" DOMException [NS_ERROR_DOM_QUOTA_REACHED: "Persistent storage maximum size reached"
code: 1014
nsresult: 0x805303f6
location: https://simple.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0f7%2FlrL3:175]

when it works (e.g., by re-loading), then I get this:

JavaScript 1.6's for-each-in loops are deprecated; consider using ES6 for-of instead ScriptSurrogate.js:345:209
"Language already set to English!" load.php:1:0
JavaScript 1.6's for-each-in loops are deprecated; consider using ES6 for-of instead ScriptSurrogate.js:345:209
"Language already set to English!" load.php:1:0
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
about:blank : Unable to run script because scripts are blocked internally. <unknown>
TypeError: document.getElementById(...) is null index.php:67:20
"Exception in store-localstorage-update:" load.php:177:843
"NS_ERROR_DOM_QUOTA_REACHED: Persistent storage maximum size reached" DOMException [NS_ERROR_DOM_QUOTA_REACHED: "Persistent storage maximum size reached"
code: 1014
nsresult: 0x805303f6
location: https://simple.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0f7%2FlrL3:175] load.php:177:881

which looks the same to me.

@Whatamidoing-WMF, do you use the NoScript Firefox extension? It looks like it causes it.

This bug was used for tracking problems caused by local gadgets, scripts, etc., which we were deploying to Wikipedia in different languages in the first half of 2015. Now that it is available as a beta feature in all the languages and basic testing is done, further problems of this kind should be reported separately, such as T105989 and T106221.

@Whatamidoing-WMF, do you use the NoScript Firefox extension? It looks like it causes it.

I have NoScript installed in Firefox but disabled for all WMF sites.