Skip to content

[Bug Report]: 自定义节点导出后再导入渲染报错TypeError: Cannot read properties of undefined (reading 'anchors') #2120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kenputon1 opened this issue Mar 28, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@kenputon1
Copy link

发生了什么?

自定义节点已添加 class FolderNodeModel extends RectNodeModel {
setAttributes() {
this.width = 90;
this.height = 50;
this.fontSize = 12;

}

}
lf.register({
type: 'FolderModel',
view: RectNode,
model: FolderNodeModel,
});导出内容为
<bpmn:definitions id="Definitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://logic-flow.org" exporter="logicflow" exporterVersion="1.2.10">
<bpmn:process isExecutable="true" id="Process">

bpmn:outgoingFlow_6a07189</bpmn:outgoing>


bpmn:incomingFlow_6a07189</bpmn:incoming>

<bpmn:sequenceFlow id="Flow_6a07189" sourceRef="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528" targetRef="6cd67c4d-8277-430a-87de-411d81274bce" isDefaultFlow="false" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process">
<bpmndi:BPMNEdge id="Flow_6a07189_di" bpmnElement="Flow_6a07189">
<di:waypoint x="355" y="100" />
<di:waypoint x="535" y="100" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528_di" bpmnElement="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528">
<dc:Bounds x="260" y="60" width="100" height="80" />
bpmndi:BPMNLabel
<dc:Bounds x="290" y="93" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="6cd67c4d-8277-430a-87de-411d81274bce_di" bpmnElement="6cd67c4d-8277-430a-87de-411d81274bce">
<dc:Bounds x="530" y="60" width="100" height="80" />
bpmndi:BPMNLabel
<dc:Bounds x="560" y="93" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
再次从后台加载render时报错
TypeError: Cannot read properties of undefined (reading 'anchors')
at Yu (chunk-6EA72NV3.js?v=cfcef300:10671:21)
at model.value (chunk-6EA72NV3.js?v=cfcef300:10860:30)
at model.value (chunk-6EA72NV3.js?v=cfcef300:10914:29)
at Ot (chunk-6EA72NV3.js?v=cfcef300:856:25)
at model.n2 (chunk-6EA72NV3.js?v=cfcef300:849:22)
at model.value (chunk-6EA72NV3.js?v=cfcef300:10829:147)
at model.value (chunk-6EA72NV3.js?v=cfcef300:11298:74)
at new t2 (chunk-6EA72NV3.js?v=cfcef300:10819:1019)
at model. (chunk-6EA72NV3.js?v=cfcef300:11249:28)
at new i2 (chunk-6EA72NV3.js?v=cfcef300:11295:39)

logicflow/core版本

1.2.27

logicflow/extension版本

1.2.27

logicflow/engine版本

No response

浏览器&环境

No response

@kenputon1 kenputon1 added the bug Something isn't working label Mar 28, 2025
Copy link

该 issue 作为 Bug Report 所提供信息的不充分,被暂时关闭了。请修改 issue 以提供最小可复现示例(可以通过以下方式:1. 在任意在线编码平台如 codesanbox 编写示例。将其保存到自己空间,然后贴上链接。2. 在自己 github 中创建一个最简单的示例,然后贴上 github 链接。3. 删除项目中的 node_modules 部分,打包项目,并拖拽到 issue 输入框中上传(或提供远程可下载地址))来重启 issue。

1 similar comment
Copy link

该 issue 作为 Bug Report 所提供信息的不充分,被暂时关闭了。请修改 issue 以提供最小可复现示例(可以通过以下方式:1. 在任意在线编码平台如 codesanbox 编写示例。将其保存到自己空间,然后贴上链接。2. 在自己 github 中创建一个最简单的示例,然后贴上 github 链接。3. 删除项目中的 node_modules 部分,打包项目,并拖拽到 issue 输入框中上传(或提供远程可下载地址))来重启 issue。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2025
@kenputon1
Copy link
Author

<bpmn:definitions id="Definitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://logic-flow.org" exporter="logicflow" exporterVersion="1.2.10">
<bpmn:process isExecutable="true" id="Process">

bpmn:outgoingFlow_6a07189</bpmn:outgoing>


bpmn:incomingFlow_6a07189</bpmn:incoming>

<bpmn:sequenceFlow id="Flow_6a07189" sourceRef="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528" targetRef="6cd67c4d-8277-430a-87de-411d81274bce" isDefaultFlow="false" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process">
<bpmndi:BPMNEdge id="Flow_6a07189_di" bpmnElement="Flow_6a07189">
<di:waypoint x="355" y="100" />
<di:waypoint x="535" y="100" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528_di" bpmnElement="b81ae5f6-a3aa-4e60-b1de-8ff9709f3528">
<dc:Bounds x="260" y="60" width="100" height="80" />
bpmndi:BPMNLabel
<dc:Bounds x="290" y="93" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="6cd67c4d-8277-430a-87de-411d81274bce_di" bpmnElement="6cd67c4d-8277-430a-87de-411d81274bce">
<dc:Bounds x="530" y="60" width="100" height="80" />
bpmndi:BPMNLabel
<dc:Bounds x="560" y="93" width="40" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant