Page MenuHomePhabricator

Cannot read property 'insertBefore' of null (ve.ce.BranchNode.setupSlugs )
Open, Needs TriagePublic

Description

TypeError: Cannot read property 'insertBefore' of null

Stack trace:

at VeCeDocumentNode.ve.ce.BranchNode.setupSlugs  URL1:450:752
at VeCeDocumentNode.ve.ce.BranchNode.setupBlockSlugs  URL1:449:744
at VeCeDocumentNode.ve.ce.BranchNode.onSplice  URL1:449:604
at VeDmDocumentNode.OO.EventEmitter.emit  URL2:227:483
at VeDmDocumentNode.ve.dm.BranchNode.splice  URL1:138:34
at splice  URL1:204:827
at Object.ve.dm.TreeModifier.static.applyTreeOperation  URL1:208:469
at Object.ve.dm.TreeModifier.static.applyTreeOperations  URL1:204:86
at VeDmTreeModifier.ve.dm.TreeModifier.process  URL1:210:62
at VeDmTransactionProcessor.ve.dm.TransactionProcessor.process  URL1:155:909

URL1: https://m.mediawiki.org/w/load.php?lang=en&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%2Cwelcome%7Cext.visualEditor.core.mobile%2Cutils%7Cext.visualEditor.mwimage.core&skin=minerva&version=1o8nd
URL2: https://m.mediawiki.org/w/load.php?lang=en&modules=ext.centralNotice.choiceData%2CgeoIP%2CstartUp%7Cext.centralauth.centralautologin%7Cext.eventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.translate.pagetranslation.uls%7Cext.uls.common%2Ci18n%2Clanguagenames%2Cmediawiki%2Cmessages%7Cjquery%2Coojs%2Coojs-router%2Csite%7Cjquery.client%2Ccookie%2Ci18n%2Cthrottle-debounce%2Culs%7Cjquery.uls.data%2Cgrid%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Crouter%2Cstorage%2Ctemplate%2Cuser%2Cutil%2Cviewport%7Cmediawiki.action.view.redirect%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.startup%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%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=gqo46

Link: https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2020.07.16/clienterror?id=AXNXMsISMQ_08tQasFJq&_g=h@114715d

Event Timeline

Jdlrobson renamed this task from Production error: Cannot read property 'insertBefore' of null to Production error: Cannot read property 'insertBefore' of null (VeCeDocumentNode.ve.ce.BranchNode.setupSlugs ).Jul 16 2020, 4:12 PM

Link: https://logstash.wikimedia.org/goto/a3d8983ee04cb4210bfc57d2c8eaa354

These links only work if they are given an absolute time offset (this one is "last 12 hours" and shows no results now).

Avoid relative searches or searches for complex strings like stack traces. For a production error report to be actionable, it's best to fill in the request ID (per the task template), or provide the "single document" permalink if reqId is unavailable.

So, this'd be happening here in ve.ce.BranchNode.js line 329:

// FIXME T126019: InternalListNode has an empty $element, so we assume that the slug goes
// at the end instead. This is a hack and the internal list needs to die in a fire.
if ( this.children[ i ] && this.children[ i ].$element[ 0 ] ) {
	child = this.children[ i ].$element[ 0 ];
	// child.parentNode might not be equal to this.$element[ 0 ]: e.g. annotated inline nodes
	child.parentNode.insertBefore( slugNode, child );
}

Which I'd say implies that we have some lightly-confused case where the child's $element has been removed from the DOM but the child hasn't been removed from the VE data model.

Not sure without further investigation whether just adding a check for the parentnode existing would fix it, or whether we need to do some more thorough cleanup to stop this state existing.

Krinkle renamed this task from Production error: Cannot read property 'insertBefore' of null (VeCeDocumentNode.ve.ce.BranchNode.setupSlugs ) to Cannot read property 'insertBefore' of null (ve.ce.BranchNode.setupSlugs ).Jul 13 2021, 12:36 AM
Krinkle updated the task description. (Show Details)