Page MenuHomePhabricator

" TypeError: surface.getModel().getSelection().getRange is not a function" appearing in the console in a specific scenario
Open, Needs TriagePublicPRODUCTION ERROR

Description

When a user clicks on the username selection option and then clicks outside the Reply box, the following error is appearing on the console:

Uncaught TypeError: this.surfaceModel.getSelection(...).getRange is not a function.

Event Timeline

Jdlrobson renamed this task from "Uncaught TypeError: this.surfaceModel.getSelection(...).getRange is not a function" appearing in the console in a specific scenario to " TypeError: surface.getModel().getSelection().getRange is not a function" appearing in the console in a specific scenario.Sep 15 2020, 8:02 PM
Jdlrobson subscribed.

There waqs an instance of this error on mobile:

https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2020.09.15/clienterror/?id=AXSTBYRqNoG2jwpwyExn

Stack trace:

 TypeError: surface.getModel().getSelection().getRange is not a function
t ve.ce.LinearDeleteKeyDownHandler.static.execute URL1:588:237
at ve.ce.KeyDownHandlerFactory.prototype.executeHandlersForKey URL1:576:69
at ve.ce.Surface.prototype.onDocumentKeyDown URL1:513:393
at ve.EventSequencer.prototype.callListener URL1:92:792
at ve.EventSequencer.prototype.onEvent URL1:90:153
at makeEventHandler/< URL1:87:935
at dispatch URL2:179:742
at add/elemData.handle URL2:176:388

URL1: https://fr.m.wikipedia.org/w/load.php?lang=fr&modules=ext.visualEditor.articleTarget%2Cbase%2Ccore%2Cdiffing%2Cicons%2Clanguage%2Cmediawiki%2CmobileArticleTarget%2Cmwalienextension%2Cmwcore%2Cmwextensions%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlanguage%2Cmwlink%2Cmwmeta%2Cmwsave%2Cmwsignature%2Cmwtransclusion%2Csanitize%2CsupportCheck%2Cswitching%2Cwelcome%7Cext.visualEditor.core.mobile%2Cutils%7Cext.visualEditor.mwimage.core&skin=minerva&version=dpeqn
URL2: https://fr.m.wikipedia.org/w/load.php?lang=fr&modules=ext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CkvStore%2CstartUp%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.echo.api%2Cinit%7Cext.eventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.growthExperiments.HelpPanel.init%7Cext.growthExperiments.SuggestedEditSession%7Cext.relatedArticles.readMore.bootstrap%2Cgateway%7Cext.wikimediaEvents.loggedin%7Cjquery%2Coojs%2Coojs-router%2Csite%7Cjquery.client%2Ccookie%2Cthrottle-debounce%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Ctemplate%2Cuser%2Cutil%2Cviewport%7Cmediawiki.ForeignApi.core%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmediawiki.template.mustache%7Cmediawiki.ui.anchor%7Cmobile.init%2Cstartup%7Cmobile.messageBox.styles%7Cmobile.ooui.icons%7Cmobile.pagelist.styles%7Cmobile.pagesummary.styles%7Cmobile.placeholder.images%7Cmobile.startup.images%7Cmw.externalguidance.init%7Cskins.minerva.icons.images.scripts%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.options%2Cscripts%7Cuser.defaults&skin=minerva&version=1o38j

This is very strange. The error suggests that the current model selection is not linear (only LinearSelection implements getRange), but ve.ce.LinearDeleteKeyDownHandler can only be executed if the model selection is currently linear.

Still occurring, but at a low rate:

https://logstash.wikimedia.org/goto/bcdf6faa06db4a6b6c396b1e643bcfd0

image.png (2,751×547 px, 59 KB)

(this is a search for "getRange is not a function", it probably combines a few different errors)

Aklapper added a subscriber: ppelberg.

Removing task assignee due to inactivity as this open task has been assigned for more than two years. See the email sent to the task assignee on August 22nd, 2022.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome!
If this task has been resolved in the meantime, or should not be worked on ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

Now only occurring on Arabic Wikipedia at low volume.

Restricted Application changed the subtype of this task from "Task" to "Production Error". · View Herald TranscriptMay 13 2025, 4:16 PM