Page MenuHomePhabricator

TypeError: Object.values is not a function
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
TypeError: Object.values is not a function
exception.trace
at Object.enom.getNotice  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.gadget.EditNoticesOnMobile%2Cswitcher&skin=minerva&version=1gwn1:8:364
at HTMLAnchorElement.<anonymous>  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.gadget.EditNoticesOnMobile%2Cswitcher&skin=minerva&version=1gwn1:16:285
at HTMLAnchorElement.jQuery.event.dispatch  https://en.m.wikipedia.org/w/load.php?lang=en&modules=es6-polyfills%2Cjquery%2Coojs%2Coojs-router%2Csite%2Cweb2017-polyfills%7Cext.centralNotice.bannerHistoryLogger%2CchoiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2ClargeBannerLimit%2ClegacySupport%2CstartUp%7Cext.centralauth.centralautologin%7Cext.eventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.growthExperiments.SuggestedEditSession%7Cjquery.client%2Ccookie%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Ctemplate%2Cuser%2Cutil%2CvisibleTimeout%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.mustache%7Cmediawiki.ui.anchor%7Cmobile.init%2Cstartup%7Cmobile.ooui.icons%7Cmobile.pagelist.styles%7Cmobile.pagesummary.styles%7Cmobile.placeholder.images%7Cmobile.startup.images%7Cmw.externalguidance.init%7Cskins.minerva.icons.images.scripts.misc%7Cskins.minerva.icons.page.issues.default.color%7Cskins.minerva.icons.page.issues.medium.color%7Cskins.minerva.icons.page.issues.uncolored%7Cskins.minerva.messageBox.styles%7Cskins.minerva.scripts&skin=minerva&version=c1jfc:78:260
at HTMLAnchorElement.elemData.handle  https://en.m.wikipedia.org/w/load.php?lang=en&modules=es6-polyfills%2Cjquery%2Coojs%2Coojs-router%2Csite%2Cweb2017-polyfills%7Cext.centralNotice.bannerHistoryLogger%2CchoiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2ClargeBannerLimit%2ClegacySupport%2CstartUp%7Cext.centralauth.centralautologin%7Cext.eventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.growthExperiments.SuggestedEditSession%7Cjquery.client%2Ccookie%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Ctemplate%2Cuser%2Cutil%2CvisibleTimeout%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.mustache%7Cmediawiki.ui.anchor%7Cmobile.init%2Cstartup%7Cmobile.ooui.icons%7Cmobile.pagelist.styles%7Cmobile.pagesummary.styles%7Cmobile.placeholder.images%7Cmobile.startup.images%7Cmw.externalguidance.init%7Cskins.minerva.icons.images.scripts.misc%7Cskins.minerva.icons.page.issues.default.color%7Cskins.minerva.icons.page.issues.medium.color%7Cskins.minerva.icons.page.issues.uncolored%7Cskins.minerva.messageBox.styles%7Cskins.minerva.scripts&skin=minerva&version=c1jfc:74:877
Impact

600+ in last 12 hrs as of 9/21/22 15:48 - https://logstash.wikimedia.org/goto/1c9f7726b87532c8f8cce9f0c4d5fc02

Notes

Mostly mobile on enwiki having to do with the banner?

Event Timeline

Perhaps we should require a check for Object.values as part of our grade A support ?

I'm not sure that we should. See also T298911: Consider checking for NodeList.prototype.forEach as part of Grade A support or providing a polyfill and T178356: Raise Grade A JavaScript requirement from ES5 (2009) to ES6 (2015).

The user agents don't completely match up with https://caniuse.com/object-values so it's possible something else is playing a part here. Majority of issues appearing in Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1 despite caniuse says the function should be available there.

That's interesting indeed. So long as it doesn't affect the software we deploy (that is, Object.values is available to our code if/when used safely; and our code doesn't fail as result of the gadget failing), though, I'm untagging Wikimedia-production-error.

Are these not filtered out from reporting as having a (solely) gadget URL as the top of the call stack? Even if not programmatically, I'd recommend documenting it as part of reporting procedure possibly, e.g. to then filter out once found, or possibly it could be made ES6-only if the authors are fine with that and we pull T75714 over the finish line.

I'll look at it. This would indeed be an issue with browsers not supporting ES6. ENOM was never tested on ES5 actually, but with any luck Object.values is the only problem. I already wrote ES5 implementations of several ES6 functions at https://en.wikipedia.org/wiki/User:Alexis_Jazz/Factotum-IE11.js which includes Object.values, so a little copy-paste should solve it.

https://en.wikipedia.org/wiki/MediaWiki_talk:Gadget-EditNoticesOnMobile.js#Edit_request_22_September_2022 should solve it.

It sorta works on IE11: loads without errors. I can't see any icons though (which isn't ENOM's fault) and clicking ENOM's (invisible) button to view the notice also triggers the (invisible) "next" button. Well what you gonna do, it's IE11 on Windows 8, in other words, a joke.

Jdlrobson claimed this task.
Jdlrobson added a subscriber: bwang.

Thanks for the prompt action here.

Screen Shot 2022-10-03 at 2.11.56 PM.png (357×895 px, 34 KB)

Reopening as this might be due to an issue in our pipeline (T319261) not indicative of an actual fix. Will need to reassess after T319261 is resolved.

Tgr subscribed.

The edit was made at 10:21 UTC, the errors disappear at the same time. The drop in the total volume of clientlogging errors is around 16h UTC, coinciding with the deploy of 1.40.0-wmf.3 at 18:16.