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

antv x6初始化画布报错Uncaught TypeError: Class constructor Ph cannot be invoked without 'new' #4342

Open
GYJ11 opened this issue Jun 13, 2024 · 2 comments

Comments

@GYJ11
Copy link

GYJ11 commented Jun 13, 2024

问题描述

在html文件中使用script标签引入https://cdnjs.cloudflare.com/ajax/libs/antv-x6/2.0.0/index.js,然后调用new X6.Graph,结果控制台报错Uncaught TypeError: Class constructor Ph cannot be invoked without 'new',画布也没加载出来

重现���接

见问题描述

重现步骤

见问题描述

预期行为

用cdn的方式引入antv x6并初始化画布不会出现报错,能够正常加载出画布

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Jun 13, 2024

👋 @GYJ11

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.

@XueMeijing
Copy link
Contributor

XueMeijing commented Jun 20, 2024

用新点的版本可以

<div id="root" style="width: 600px;height: 600px;"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/antv-x6/2.18.1/index.js"></script>
<script>
  const graph = new X6.Graph({
    container: document.querySelector('#root'),
    grid: true
  })
  console.log('X6', X6)
  console.log('graph', graph)
</script>

image

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