Skip to content
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

连接桩port id 热更新提示错误 #4064

Open
Niefee opened this issue Nov 30, 2023 · 6 comments
Open

连接桩port id 热更新提示错误 #4064

Niefee opened this issue Nov 30, 2023 · 6 comments

Comments

@Niefee
Copy link

Niefee commented Nov 30, 2023

Describe the bug

mx_screencap_20231130_173928

连接点的id是自定义的,热更新就报错。
麻烦看一下,要是id再加一个随机数就正常,你们用UUID生产,每次热更新都不一样,所以没问题,我是固定id的,就报错。

Your Example Website or App

1

Steps to Reproduce the Bug or Issue

1

Expected behavior

1

Screenshots or Videos

1

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 2.11.1]

Additional context

1

@America-first-melon
Copy link

我得一个cell有 100个 port, 比如我要批量隐藏,目前使用 ports.forEach(e => e.setProp('style/visibility', 'hidden')) 会比较慢。

于是,我想先 removePorts() 再 addPorts(), 当在 addPorts 传入得数组带 id 时 ,也会提示这个错误。。

console.time('del')
node.removePorts()
console.timeEnd('del')

node.addPorts(por.map((e, i) => {
        return {
          // id: e,
          group: 'right',
          attrs: {
            text: {
              text: i,
            },
          },
        }
      }))

image

@Niefee
Copy link
Author

Niefee commented Dec 4, 2023

感觉就是组件在unmount的时候,没有清除数据,导致id重复 @America-first-melon @lloydzhou

@cnyballk
Copy link
Contributor

我也是自定义portid,不过没见过这个错

@Niefee
Copy link
Author

Niefee commented Dec 25, 2023

我也是自定义portid,不过没见过这个错

保存热更新的时候报错,你用vite吗 @cnyballk

@cnyballk
Copy link
Contributor

我也是自定义portid,不过没见过这个错

保存热更新的时候报错,你用vite吗 @cnyballk

我不是用的vite 我用的umi,我等会用vite试试看

@cnyballk
Copy link
Contributor

vite ok的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants