Page MenuHomePhabricator

Uncaught TypeError: Cannot call method 'initialize' of undefined
Closed, ResolvedPublic

Description

I got
Uncaught TypeError: Cannot call method 'initialize' of undefined
on
https://www.wikidata.org/wiki/Q3092
from this script:

<div id="siteNotice"><!-- CentralNotice --><script>mw.centralNotice.initialize();</script></div>


Version: unspecified
Severity: normal

Details

Reference
bz41750

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:10 AM
bzimport set Reference to bz41750.
bzimport added a subscriber: Unknown Object (MLST).

pgehres wrote:

CentralNotice is working just fine for me on wikidata. I wonder if the ResourceLoader dependencies are not set correctly and sometimes the initialization happens too early.

The bigger question, though, is why is CentralNotice being shown on WikiData at the moment. It hasn't been added to meta, so we have no way of targeting it. There must be a misconfiguration somewhere.

mwalker wrote:

To the best of my knowledge the only way this error could have occurred is if ResourceLoader failed to load the CN controller script. mw.centralNotice.initialize() has been in existence since we moved to RL...

Do we have any further details about what browser this was experienced under? That might play a part...

For the record, CN seems to be working fine for me on Opera 12

(In reply to comment #2)

Do we have any further details about what browser this was experienced under?
That might play a part...

Google Chrome 22.0.1229.94, on a slow connection. So far it only happened once.

(In reply to comment #1)

The bigger question, though, is why is CentralNotice being shown on WikiData at
the moment. It hasn't been added to meta, so we have no way of targeting it.
There must be a misconfiguration somewhere.

CC'ing wikidata-bugs@ and setting wikibugs keyword.

mwalker wrote:

WikiData target is enabled as of https://gerrit.wikimedia.org/r/31859 -- LocalSettings will need to be changed for WikiData, $wgNoticeProject should be set to 'wikidata'.

Bug still open on slow/chrome 22 -- need to take a look at how the skin hooks are generated and where.

It's probably not related to this specific bug, but $wgResourceLoaderExperimentalAsyncLoading affects where some of the hooks are generated. I think this is only turned on on test2.wiki though.

mwalker wrote:

Hopefully the patch in the other bug solves this problem *crosses fingers*

*** This bug has been marked as a duplicate of bug 41937 ***