Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'modules' of undefined
Closed, ResolvedPublicPRODUCTION ERROR

Description

Screen Shot 2021-01-07 at 12.07.44 PM.png (838×2 px, 155 KB)

A new error appearing for group0 wikis. Volume is high for group0 wikis so this should block further deployment and propagating the error further

`
at fire  URL1:62:209
at Object.fireWith  URL1:63:402
at Object.fire  <anonymous>:341:482
at URL2:29:957

URL1: https://ca.wikipedia.org/w/load.php?lang=ca&modules=ext.CodeMirror%2Ccharinsert%7Cext.CodeMirror.data%7Cjquery%2Coojs-ui-core%7Cjquery.ui%7Coojs-ui.styles.icons-editing-styling&skin=vector&version=evy3e
URL2: https://ca.wikipedia.org/w/load.php?lang=ca&modules=ext.wikiEditor&skin=vector&version=2juza

On logstash: https://logstash.wikimedia.org/goto/a16b6a52e13221b83e6661439a1550a8

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

WMDE has recently been working on CodeMirror, not sure if anything they did is related. This sounds more like an issue with module loading and not a bug within CodeMirror itself, but pinging @Lena_WMDE just in case.

Ah, yes, looks like I over-looked a re-use of a scope var.

Working hypothesis is that this is a gadget; previously, the code order would have had CodeMirror run and then be deleted by the gadget, making the code silently broken, but now there's a tick when the gadget can break things before we run, so it errors.

Change 654927 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/CodeMirror@master] Guard against WikiEditor being removed by the time the hook runs

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

The offending change made sure that the syntax highlight plugin runs more reliably by running as a hook instead of an event.

It appears that now the plugin can load after WikiEditor, something is removing WikiEditor from the main input in the intervening time, or more likely, completely replacing the main input (maybe an editor gadget like WikiEd?).

The above patch just bails if the editor input no longer has WikiEditor data when the initialisation runs.

Jdforrester-WMF changed the subtype of this task from "Task" to "Production Error".Jan 7 2021, 9:21 PM

Change 654927 merged by jenkins-bot:
[mediawiki/extensions/CodeMirror@master] Guard against WikiEditor being removed by the time the hook runs

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

Change 654857 had a related patch set uploaded (by Jforrester; owner: Esanders):
[mediawiki/extensions/CodeMirror@wmf/1.36.0-wmf.25] Guard against WikiEditor being removed by the time the hook runs

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

Change 654857 merged by jenkins-bot:
[mediawiki/extensions/CodeMirror@wmf/1.36.0-wmf.25] Guard against WikiEditor being removed by the time the hook runs

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

Mentioned in SAL (#wikimedia-operations) [2021-01-07T21:43:40Z] <jforrester@deploy1001> Synchronized php-1.36.0-wmf.25/extensions/CodeMirror/resources/ext.CodeMirror.js: T271457 Guard against WikiEditor being removed by the time the hook runs (duration: 01m 05s)