Page MenuHomePhabricator

JS ReferenceErrors due to ResourceLoader changes
Closed, ResolvedPublic

Description

We're getting a whole load of ReferenceErrors most likely caused by this change in core: https://gerrit.wikimedia.org/r/#/c/152122/


Version: unspecified
Severity: blocker
Whiteboard: u=dev c=frontend p=0

Details

Reference
bz69468

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 3:43 AM
bzimport set Reference to bz69468.
bzimport added a subscriber: Unknown Object (MLST).

Referenced from https://gerrit.wikimedia.org/r/#/c/152122/.

Can you provide more information about this Wikidata issue? What is the error message, call stack, steps to reproduce it?

(In reply to Krinkle from comment #1)

Referenced from https://gerrit.wikimedia.org/r/#/c/152122/.

Can you provide more information about this Wikidata issue? What is the
error message, call stack, steps to reproduce it?

See e.g. here: http://wikidata.beta.wmflabs.org/wiki/Q21016?debug=true

If I undo the following changes it works fine again:
https://gerrit.wikimedia.org/r/#/c/152122/5/includes/resourceloader/ResourceLoader.php
https://gerrit.wikimedia.org/r/#/c/152122/5/resources/Resources.php

gerritadmin wrote:

Change 154050 had a related patch set uploaded by Tobias Gritschacher:
Remove ResourceLoader dependencies to jquery and mediawiki

https://gerrit.wikimedia.org/r/154050

gerritadmin wrote:

Change 154050 merged by jenkins-bot:
Remove ResourceLoader dependencies to jquery and mediawiki

https://gerrit.wikimedia.org/r/154050

I've looked at that bug in different ways but all I've found is various hacks and inconsistencies in how they do things different in ways I can't find documentation of. One important thing that stood out (but might not be the only thing) is that wikidata extensions have a bunch of modules with a ResourceLoader dependency on "jquery" and/or "mediawiki" which is a recipe for disaster. There are core phpunit structure tests that point out this illegal dependency. It can cause the base namespaces to be redefined asynchronously, thus dereferencing any properties defined since (eg mw.config, mw.util, etc).

we removed all the explicit dependencies on the mediawiki and jquery module and everything works again.

thanks Krinkle for helping debug this.