antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.7k stars 1.7k forks source link

x6 2.0版本新增树节点报错,复制得示例 #3351

Closed haosusu closed 1 year ago

haosusu commented 1 year ago

Describe the bug

image image

Your Example Website or App

1

Steps to Reproduce the Bug or Issue

新增树节点或者删除都会报这个错

Expected behavior

版本1.0不报错,2.0报错,怎么兼容

Screenshots or Videos

No response

Platform

Additional context

No response

x6-bot[bot] commented 1 year ago

👋 @haosusu

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

jianjianghui commented 1 year ago

28f78f0c6cca447d653d34614a74b9a 77d157b23ecc7791f9e26ad94a0a320 同一套业务代码,左侧好的,右侧出问题了;右侧是流水线部署的,每次都会npm install! 所以这个问题??????

jianjianghui commented 1 year ago

经过测试 @antv/x6 2.5.3版本会出现该问题;指定2.5.1版本后该问题不存在;

jianjianghui commented 1 year ago

package.json 将 "@antv/x6": "^2.3.0" 改为 "@antv/x6": "2.3.0"

jianjianghui commented 1 year ago

https://github.com/antvis/X6/commit/1de8ebe77abe9820229c3e99f8b75ee6f6058112 该问题由这个提交引发,原有逻辑会修改this.willRemoveViews的引用地址,而新逻辑则直接将解构的数据存入到新的变量中,并没有覆盖this.willRemoveViews;导致其他使用 this.willRemoveViews的代码因获取不到最新的数据而报错

lloydzhou commented 1 year ago

建议这里willRemoveViews直接变成Set<ViewId>() 访问view对象还是从this.views获取

NewByVector commented 1 year ago

更新到 @antv/x6@2.5.4

x6-bot[bot] commented 7 months ago

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.