Page MenuHomePhabricator

TypeError: missingLanguagesPanel.append is not a function / TypeError: Cannot read property 'indexOf' of undefined at getMissingFrequentLanguages
Closed, ResolvedPublicPRODUCTION ERROR

Description

11726 errors in the last 7 days and 996 in the last 12hrs. (Over 1000 errors in last 12hrs is a train blocker https://wikitech.wikimedia.org/wiki/Deployments/Holding_the_train#Issues_that_hold_the_train). Please fix ASAP.

Error
normalized_message
TypeError: missingLanguagesPanel.append is not a function
exception.trace
at createMissingLanguagesPanel  <anonymous>:17:23
at <anonymous>:18:890
at Object.hooks. anonymous function).hooks.(anonymous function).fire (<anonymous>:377:636
at mw.loader.using.then.then.onOpen  <anonymous>:223:407
at <anonymous>:2:460

TypeError: Cannot read property 'indexOf' of undefined is presumably the same issue:

at getMissingFrequentLanguages  <anonymous>:17:792
at <anonymous>:18:755
at Object.hooks. anonymous function).hooks.(anonymous function).fire (<anonymous>:373:636
at mw.loader.using.then.then.e.onOpen  <anonymous>:219:407
at https://ja.m.wikipedia.org/w/load.php?lang=ja&modules=mobile.languages.structured&skin=minerva&version=amwya:2:460
tags
	
`
Impact
Notes

Event Timeline

Jdlrobson created this task.
Jdlrobson renamed this task from TypeError: missingLanguagesPanel.append is not a function to TypeError: missingLanguagesPanel.append is not a function / TypeError: Cannot read property 'indexOf' of undefined at getMissingFrequentLanguages.May 13 2022, 3:41 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Language-Team.

This is on the cusp of being a train blocker so I am marking this as a blocker for 1.39.0-wmf.13 since 1.39.0-wmf.12 is only a few days away.

From the details of errors (require login), I see the errors are coming from old chrome browsers in old android version. Specifically from Chrome versions < 50.

Element.append is not available in Chrome<54.

TypeError: Cannot read property 'indexOf' of undefined is presumably the same issue:

at getMissingFrequentLanguages  <anonymous>:17:792
at <anonymous>:18:755
at Object.hooks. anonymous function).hooks.(anonymous function).fire (<anonymous>:373:636
at mw.loader.using.then.then.e.onOpen  <anonymous>:219:407
at https://ja.m.wikipedia.org/w/load.php?lang=ja&modules=mobile.languages.structured&skin=minerva&version=amwya:2:460
tags
	
`

This is happending because we are assuming languageSearcher.options.deviceLanguage is not null/undefined. But it can be undefined as per the documentation getDeviceLanguageOrParent method at MobileFrontend extension.

Change 791827 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] mffrequentlanguages entryopoint: Handle the case of undefined deviceLanguage

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

Change 791828 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] Limit the CX entrypoints to ES6 only browsers

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

Change 791829 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] Use appendChild instead of append to avoid browser compatibility issues

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

Change 791827 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] mffrequentlanguages entryopoint: Handle the case of undefined deviceLanguage

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

Change 791829 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Use appendChild instead of append to avoid browser compatibility issues

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

Change 791828 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Limit the CX entrypoints to ES6 only browsers

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

Thanks for the speedy handling of this one <3!

@Jdlrobson it seems from the history that this isn't a train blocker. Can you confirm?

Unable to reproduce issue after fix in production. Tested in Chrome and Safari browsers