Page MenuHomePhabricator

CX2: Uncaught TypeError: Cannot read property 'element' of null at VeCeCXTransclusionInlineNode.ve.ce.View.initialize (ve.ce.View.js?9c8a2:109)
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Start translating en:Vantaa to Spanish
  2. Fill in the paragraphs starting "Vantaa is bordered by" and "The largest airport in Finland"
  3. Save and refresh the page (can also involve returning to dashboard and opening the draft again)
  4. Click on the only reference [1] in the "The largest airport in Finland" paragraph

Observed the following error in the console:

Uncaught TypeError: Cannot read property 'element' of null
    at VeCeCXTransclusionInlineNode.ve.ce.View.initialize (ve.ce.View.js?9c8a2:109)
    at VeCeCXTransclusionInlineNode.ve.ce.LeafNode.initialize (ve.ce.LeafNode.js?2240c:45)
    at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.render (ve.ce.GeneratedContentNode.js?4a56e:220)
    at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.render (ve.ce.MWTransclusionNode.js?b8bab:180)
    at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.doneGenerating (ve.ce.GeneratedContentNode.js?4a56e:354)
    at ve.ce.GeneratedContentNode.js?4a56e:291
    at fire (jquery.js?6a07d:3268)
    at Object.fireWith [as resolveWith] (jquery.js?6a07d:3398)
    at Object.deferred.(/w/anonymous function) [as resolve] (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3736:36)
    at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.onParseSuccess (ve.ce.MWTransclusionNode.js?b8bab:168)

Note: There is no direct reference to any CX code in the call stack, except by the class VeCeCXTransclusionInlineNode. Might be something that our subclassing breaks or some of our methods do earlier in the process.

Aside: the reference on the paragraph "Vantaa is bordered by" goes missing in translation.
Aside: trying to fill in the lead section causes T205420: CXServer fails with HTTP 500: "MT processing error: undefined"

Event Timeline

Pginer-WMF triaged this task as Medium priority.Sep 26 2018, 7:03 AM
Pginer-WMF moved this task from Needs Triage to CX2 on the ContentTranslation board.

I can confirm this is still happening.

Another testing example available in duplicate ticket T216878, involving translation of en:Specific_rotation to Spanish.

Petar.petkovic added a subscriber: Jpita.

I've tried reproducing this. Started translation of en:Vantaa to Spanish and added paragraphs starting with "Vantaa is bordered by Helsinki" and "The largest airport in Finland". Waited for save and reloaded the page. Clicked on only reference to see no error. Reference card was empty.

Moving to QA for @Jpita to check.

Observation on other two points from description are that reference on the paragraph "Vantaa is bordered by" is missing and trying to translate leading paragraph leads to:

TypeError: Cannot read property 'shallowCloneFromRange' of null
    at VeDmConverter.ve.dm.Converter.getDomFromNode (http://localhost/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Converter.js?1a762:1241:21)
    at VeInitMwCXTarget.ve.init.mw.CXTarget.changeContentSource (http://localhost/extensions/ContentTranslation/modules/ve-cx/init/ve.init.mw.CXTarget.js?67ea3:950:25)
    at VeInitMwCXTarget.<anonymous> (http://localhost/extensions/ContentTranslation/modules/ve-cx/init/ve.init.mw.CXTarget.js?67ea3:716:16)
    at mightThrow (http://localhost/resources/lib/jquery/jquery.js?f16ce:3535:29)
    at process (http://localhost/resources/lib/jquery/jquery.js?f16ce:3603:12)

Then, I went into looking at two duplicate tickets. In example from T216878, I saw no problem.
When checking T219035, I saw a problem with translating second paragraph. Same error from above is proceeded by:

Uncaught TypeError: Cannot read property 'getRange' of undefined
    at Object.ve.dm.MWReferenceNode.static.toDomElements (ve.dm.MWReferenceNode.js?102a3:122)
    at Object.ve.dm.CXReferenceNode.static.toDomElements (ve.dm.CXReferenceNode.js?2295e:60)
    at VeDmConverter.ve.dm.Converter.getDomElementsFromDataElement (ve.dm.Converter.js?1a762:494)
    at VeDmConverter.ve.dm.Converter.getDomSubtreeFromData (ve.dm.Converter.js?1a762:1492)
    at VeDmConverter.ve.dm.Converter.getDomSubtreeFromModel (ve.dm.Converter.js?1a762:1266)
    at VeDmConverter.ve.dm.Converter.getDomFromModel (ve.dm.Converter.js?1a762:1222)
    at VeDmConverter.ve.dm.Converter.getDomFromNode (ve.dm.Converter.js?1a762:1240)
    at MwCXTranslationTracker.mw.cx.TranslationTracker.processSectionChange (mw.cx.TranslationTracker.js?84780:299)
    at MwCXTranslationTracker.mw.cx.TranslationTracker.processChangeQueue (mw.cx.TranslationTracker.js?84780:255)
    at MwCxTranslationController.mw.cx.TranslationController.processChangeQueue (mw.cx.TranslationController.js?9e20a:130)

Final verdict: Problem with errors when clicking on reference is gone, but there are other errors when adding paragraphs. Should be fixed as part of a separate ticket.

Jpita claimed this task.

Final verdict: Problem with errors when clicking on reference is gone, but there are other errors when adding paragraphs. Should be fixed as part of a separate ticket.

@Petar.petkovic @Pginer-WMF is there a ticket for this?

Final verdict: Problem with errors when clicking on reference is gone, but there are other errors when adding paragraphs. Should be fixed as part of a separate ticket.

@Petar.petkovic @Pginer-WMF is there a ticket for this?

Not that I know of.

Final verdict: Problem with errors when clicking on reference is gone, but there are other errors when adding paragraphs. Should be fixed as part of a separate ticket.

@Petar.petkovic @Pginer-WMF is there a ticket for this?

Not that I know of.

Petar, can you create the ticket? When checking the comments above the context seems to be a bit split through several comments and other tickets. So maybe you can collect the different pieces and put them together more easily.
Thanks!

Petar, can you create the ticket? When checking the comments above the context seems to be a bit split through several comments and other tickets. So maybe you can collect the different pieces and put them together more easily.
Thanks!

I was not able to reproduce same errors, but actually got different one reported in T234220. Whether that cxserver error covers TypeError: Cannot read property 'shallowCloneFromRange' of null, when translating first paragraph of en:Vantaa to Spanish, is unclear.

Cannot reproduce Uncaught TypeError: Cannot read property 'getRange' of undefined when translating second paragraph of en:Time_Inc. to Catalan.