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

官方案例react 自定义节点进去报 Error: Node with name 'algo-node-1' does not exist. #3844

Closed
myBoringCode opened this issue Aug 11, 2023 · 6 comments

Comments

@myBoringCode
Copy link
Contributor

myBoringCode commented Aug 11, 2023

问题描述

官方案例react 自定义节点进去报
Error: Node with name 'algo-node-1' does not exist.

重现链接

1

重现步骤

  1. 下载官方源码2.11.3
  2. pnpm install 按照依赖
  3. 启动 example 查看效果
    cd examples/x6-example-features
    pnpm run start
  4. 点击react进入react 自定义子页面

预期行为

react 自定义子页面能够正常运行

平台

  • 操作系统: Windows
  • 网页浏览器: Google Chrome
  • X6 版本: 2.11.3

屏幕截图或视频(可选)

1

补充说明(可选)

1

@x6-bot
Copy link
Contributor

x6-bot bot commented Aug 11, 2023

👋 @myBoringCode

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.

@myBoringCode
Copy link
Contributor Author

@myBoringCode
Copy link
Contributor Author

'@antv/x6-react-shape' register
register({
shape: 'algo-node-1',
width: 144,
height: 28,
effect: ['data'],
component: NodeComponent,
})
调用的文件是http://localhost:8000/node_modules/.pnpm/registry.npmmirror.com+@[email protected]/node_modules/@antv/x6/es/registry/registry.js,
但是在读取的时候
const node = graph.addNode({
shape: 'algo-node-1',
x: 80,
y: 80,
data: {
name: '逻辑回归',
},
})
调用的是http://localhost:8000/packages/x6/es/registry/registry.js 文件

@myBoringCode
Copy link
Contributor Author

可能缓存的原因, 或者版本的原因, 升级pnpm版本到8.8.12后正常了

@jiangxin829
Copy link

我也遇到了,感谢。pnpm从8.6.12升级到8.8.0后,删除nodemodule/.vite后重新生成依赖,解决问题

@x6-bot
Copy link
Contributor

x6-bot bot commented Oct 7, 2024

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.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants