Page MenuHomePhabricator

[SectionTranslation] TypeError: Cannot read property 'getBoundingClientRect' of undefined
Open, Needs TriagePublic

Description

Error

TypeError: Cannot read property 'getBoundingClientRect' of undefined at animateToolbarIntoView  https://bn.m.wikipedia.org/w/load.php?lang=bn&modules=ext.visualEditor.articleTarget%2Cbase%2Ccore%2Cdiffing%2Cicons%2Clanguage%2Cmediawiki%2CmobileArticleTarget%2Cmwalienextension%2Cmwcore%2Cmwextensions%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlanguage%2Cmwlink%2Cmwsave%2Cmwtransclusion%2Csanitize%2CsupportCheck%2Cswitching%2CtargetLoader%2Ctrack%2Cve%2Cwelcome%7Cext.visualEditor.core.mobile%2Cutils%7Cext.visualEditor.core.utils.parsing%7Cext.visualEditor.mwimage.core&skin=contenttranslation&version=1cut7:1039:797

Event Timeline

Jdlrobson subscribed.

This is also occurring as "TypeError: undefined is not an object (evaluating '$header[0].getBoundingClientRect')"
https://logstash.wikimedia.org/app/dashboards#/doc/logstash-*/logstash-2022.05.16?id=u_I8zIABv2PODa7FkY6n

This is also occurring as "TypeError: undefined is not an object (evaluating '$header[0].getBoundingClientRect')"
https://logstash.wikimedia.org/app/dashboards#/doc/logstash-*/logstash-2022.05.16?id=u_I8zIABv2PODa7FkY6n

getBoundingClientRect is a common browser API that is used by many different code bases. These issues have nothing in common. Please file a separate task :)

The sample you link is from MobileArticleTarget.js, as shown by Codesearch. Another signal is that the stack traces don't match (at animateToolbarIntoView is in MobileArticleTarget.js). Another signal is that $header does not appear in SectionTranslation's code base.

getBoundingClientRect is a common browser API that is used by many different code bases. These issues have nothing in common. Please file a separate task :)

I do realize of course that getBoundingClientRect is a common API, but if you look at the bug report I linked to the stack trace is identical to the stack trace in the description:

at animateToolbarIntoView https://fa.m.wikipedia.org/w/load.php?lang=fa&modules=ext.visualEditor.articleTarget%2Cbase%2Ccore%2Cdiffing%2Cicons%2Clanguage%2Cmediawiki%2CmobileArticleTarget%2Cmwalienextension%2Cmwcore%2Cmwextensions%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlanguage%2Cmwlink%2Cmwsave%2Cmwtransclusion%2Csanitize%2CsupportCheck%2Cswitching%2CtargetLoader%2Ctrack%2Cve%2Cwelcome%7Cext.visualEditor.core.mobile%2Cutils%7Cext.visualEditor.core.utils.parsing%7Cext.visualEditor.mwimage.core&skin=contenttranslation&version=xw1ox:1042:687

and the page is
https://fa.m.wikipedia.org/wiki/Special:ContentTranslation?title=Special:ContentTranslation

What makes you think these bugs are not the same?
SectionTranslation uses VisualEditor, so the bug could be in either of those codebase. My guess is that because SectionTranslation uses its own dedicated skin, there is a problem here with the VisualEditor code which isn't taking into account some difference.

Ack, I see what you mean.

The task description was missing a sample link and other details, so I assumed it was a ContextTranslation bug as filed. But. you're right, it's (only) a VisualEditor bug, with the added details futher pinning it down through the traces and error message formats as reported by multiple different browser enginers, for otherwise the exact same error. It seems likely specific to how the VE code is excercised by CX, but indeed a singular issue.