Page MenuHomePhabricator

Errors in mw-client-NEW-errors TypeError: Cannot read properties of undefined (reading 'Keys')
Closed, ResolvedPublicBUG REPORT


Stack Trace

at HTMLAnchorElement.phonosClickHandler

File Url

Error count


Logstash Url

Event Timeline

Mo will add error rate and link to logstash.

Mo will add error rate and link to logstash.


TypeError: Cannot read properties of undefined (reading 'Keys') introduced by OO.ui.Keys.ENTER (1af2997)? I can't replicate this though..

Related: rEPHN1af2997bad71: Trigger button on enter as well as click, T347056: Unable to activate Phonos button with keyboard when it has an error

I guess this happens on a page where no OOUI is used elsewhere? i.e. we're trying to avoid using OOUI before the click, but then to determine the click we're using it! Oops. (My mistake, I think.) We can probably just use the key's codes directly (or maybe via variables for easier reading).

Change 973387 had a related patch set uploaded (by Fomafix; author: Fomafix):

[mediawiki/extensions/Phonos@master] Use static integers instead of OO.ui.Keys

modules/ext.phonos.init.js uses OO.ui.Keys. OO.ui.Keys is defined in module oojs-ui-core. In extension.json there is no dependency on this module. Therefor error can happen if the module in not loaded yet.

oojs-ui-core is a very large module. A dependency requires to load this large module just for the small static values:

OO.ui.Keys.ENTER = 13;
OO.ui.Keys.SPACE = 32;

I suggest to use the static integers instead of adding a dependency on module oojs-ui-core. I created I10c7fd827be559ba8dcdec01c38ee6ace63922aa ( for this.

Change 973387 merged by jenkins-bot:

[mediawiki/extensions/Phonos@master] Use static integers instead of OO.ui.Keys

TheDJ subscribed.

The issue has dropped from logstash. Keeping ticket open so that the team can complete their own processes.

MusikAnimal assigned this task to Fomafix.
MusikAnimal subscribed.

Fomafix's approach seems perfect given the circumstances (we don't want to load OOUI on page load). Thank you for taking care of this!