⚓ T199484 Clicking on red link gives error "Uncaught TypeError: Cannot read property 'start' of null"


Article Images
  1. Click on a red link on read mode such as this one:

https://en.wikipedia.org/w/index.php?title=Examples/Red&action=edit&redlink=1

The following error appears:

VM108:1078 Uncaught TypeError: Cannot read property 'start' of null
    at jQuery.fn.init.getCaretPosition (<anonymous>:1078:106)
    at jQuery.fn.init.$.fn.textSelection (<anonymous>:108:121)
    at jQuery.fn.init.$.fn.wikiEditor (load.php?debug=false&lang=en&modules=ext.wikiEditor&skin=vector&version=03d7n1u:5)
    at Object.CiteTB.init (index.php?title=MediaWiki:RefToolbar.js&action=raw&ctype=text/javascript:128)
    at index.php?title=MediaWiki:RefToolbarConfig.js&action=raw&ctype=text/javascript:233

Event Timeline

Deskana triaged this task as Medium priority.Aug 7 2018, 6:57 PM

I do not like errors in production, even if they do not seem to be causing any problems, because they often end up causing more problems down the line. Needs investigation.

Looks like the editor is originating from gadget code, requesting a caret position from the editor when there is none, but we can guard against that.

If the fix for this has been deployed on 21Aug2018, I would like to inform that I still see the following error when visiting the link found in the task description.

TypeError: Argument 1 of Window.getComputedStyle is not an object.

I also get an error when visiting https://en.wikipedia.org/w/index.php?title=Wikipedia:Teahouse&action=edit&section=new which is the place in which I initially noticed this issue long before the proposed fix was made. The errors I get there is:

Argument 1 of Window.getComputedStyle is not an object.
TypeError: range is null, can't access property "end" of it

So, should this task be re-opened?

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits