Invalid XML due to $type property

I recently updated my bpmn-js libraries to version 0.26.6. However, now that I have done so, I have ran into an issue with my diagrams.

For some reason, when creating a new diagram, the XML output is invalid. The problem seems to be a $type property that is added to several elements. For example,

<bpmn:sequenceFlow id="SequenceFlow_09sotu1" name="x!=1" sourceRef="ExclusiveGateway_0s5p892" targetRef="EndEvent_1iu1gx7" $type="bpmn:SequenceFlow" di="[object Object]"><bpmn:conditionExpression xsi:type="bpmn:tFormalExpression" language="JavaScript">x!=1</bpmn:conditionExpression></bpmn:sequenceFlow>

or

<bpmndi:BPMNEdge id="SequenceFlow_09sotu1_di" bpmnElement="SequenceFlow_09sotu1" $type="bpmndi:BPMNEdge"><di:waypoint x="1032" y="235" />

This also happens when opening an old diagram (old as in “created” before updating the libraries") and editing one of the existing elements. The $type property is added to whatever I update.

Has anyone ran into this issue in the past?

The most recent version of bpmn-js is v0.27.3. Please verify that the bugs are still present in that version.

If that is the case, try to provide us with an example or a step by step guide that helps us to reproduce the issue you’re seeing.

Nevermind, found the problem. It seems that the version of the camunda-bpmn-moddle I was using (https://github.com/camunda/camunda-bpmn-moddle/blob/master/resources/camunda.json) isn’t fully compatible with version 0.27 or 0.26 of the bpmn-js libraries. The solution was to backtrack the bpmn-js version until I found one that wasn’t conflicting with what the moddle was expecting.