Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'end' of null / range is null
Open, Needs TriagePublicPRODUCTION ERROR

Description

https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2020.10.07/clienterror/?id=AXUD6T7x2lgCwKx7Jq6g
23 errors every 12hrs (doesn't include Wikipedia)

at jQuery.fn.init.getCaretPosition  URL1:870:491
at jQuery.fn.init.$.fn.textSelection  <anonymous>:190:237
at jQuery.fn.init.$.fn.wikiEditor  URL2:11:60
at HTMLDocument.<anonymous>  URL2:5:224
at mightThrow  URL3:78:149
at process  URL3:78:808

URL1: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.visualEditor.core%2Cmwwikitext&skin=vector&version=1qvi7
URL2: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.wikiEditor&skin=vector&version=1lgrk
URL3: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.centralauth.centralautologin.clearcookie%7Cext.cx.entrypoints.contributionsmenu%7Cext.cx.widgets.callout%7Cext.echo.api%2Cinit%7Cjquery%2Csite%7Cjquery.ui%7Cmediawiki.page.watch.ajax&skin=vector&version=8f7zy

Event Timeline

this seems to happen when gadgets call the addDialog hook.

e.g. $target.wikiEditor('addDialog', dialogobj);` in https://ko.wikipedia.org/w/index.php?title=%EB%AF%B8%EB%94%94%EC%96%B4%EC%9C%84%ED%82%A4:RefToolbar.js

This is now being treated as logspam and filtered out of the logstash board.

Jdlrobson renamed this task from Uncaught TypeError: Cannot read property 'end' of null to Uncaught TypeError: Cannot read property 'end' of null / range is null.Apr 14 2021, 7:08 PM

I would like to try tackling this, but I need to know if this bug still exists. It appears RefToolbar (or at least the enwp version) catches the TypeError now, but I don't know if it pops up elsewhere.

Edit: I just don't see how addDialog can be the cause. Its code path only calls jQuery.textSelection in an event handler when the dialog is closed. The stack trace in the description looks more like the initial WikiEditor setup call.

Restricted Application changed the subtype of this task from "Task" to "Production Error". · View Herald TranscriptJun 4 2026, 7:26 AM