Page MenuHomePhabricator

TypeError: Cannot set properties of null (setting 'id')
Closed, ResolvedPublicPRODUCTION ERROR

Description

138 issues in last 7 days, stack trace points to Code Mirror module and eval usage.

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

Steps to replicate the issue (include links if applicable):

What happens?:

What should have happened instead?:

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptApr 29 2026, 5:14 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
MusikAnimal subscribed.

Many or most of the URLs seem to be when editing a section of an older version of a page (example). This shows the "Section editing not supported" error, which I've actually never seen before. It seems to produce a myriad of other JS errors, in OOUI, various gadgets/user scripts, and whatever else is normally instructed to load on action=edit.

Or is the thingy writing to Logstash adding in the oldid to the URL?

stack trace points to Code Mirror module and eval usage.

To be clear, I think the eval is coming from something different, perhaps whatever mechanism is detecting the error. There is no use of eval in CodeMirror, as far as I know.

Change #1284875 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] ext.CodeMirror.init: guard against there being no textarea

https://gerrit.wikimedia.org/r/1284875

MusikAnimal changed the task status from Open to In Progress.May 7 2026, 9:59 PM
MusikAnimal claimed this task.

Based on the stack trace this should fix it for CodeMirror. On my local, other unrelated things are erroring out too, such as Edit Recovery. Not sure if those are just getting ignored in Logstash, but my guess is a lot of components (and certainly on-wiki gadgets and scripts) are not well-suited to guard against the "Section editing not supported" error.

The bigger question perhaps is how so many users (or web scrapers?) are ending up at URLs like action=edit&oldid=123&section=1, as those aren't exposed in the UI at all.

Change #1284875 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] ext.CodeMirror.init: guard against there being no textarea

https://gerrit.wikimedia.org/r/1284875

MusikAnimal moved this task from Bugs to Done on the MediaWiki-extensions-CodeMirror board.

No errors since May 21