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

An error is reported when you use WorkEnable #6529

Open
WangHanZ opened this issue Nov 15, 2024 · 0 comments
Open

An error is reported when you use WorkEnable #6529

WangHanZ opened this issue Nov 15, 2024 · 0 comments

Comments

@WangHanZ
Copy link

WangHanZ commented Nov 15, 2024

Describe the bug / 问题描述

layout failed DOMException: Failed to execute 'postMessage' on 'Worker': function () { } could not be cloned.
at LayoutController.runWebworker (webpack-internal:///./node_modules/@antv/g6-pc/es/graph/controller/layout.js:500:14)
at eval (webpack-internal:///./node_modules/@antv/g6-pc/es/graph/controller/layout.js:455:22)

将layout.min.js放在了dcn地址也可以访问 到这个layout.min.js文件,
this.topoGraph.data({
nodes: obj.nodes,
edges: obj.edges
})
this.topoGraph.updateLayout({
type: 'force2',
clustering: true,
animate: false,
nodeClusterBy: 'comboId',
linkDistance: 20, // 可选,边长
nodeStrength: 60, // 可选
nodeSize: 10,
edgeStrength: 15,
workerEnabled: true,
workerScriptURL: ${window.location.origin}/layout.min.js,

        onLayoutEnd: () => { // 可选
          this.topoGraph.fitCenter()
        }
      })
      this.topoGraph.render()

但是执行得时候汇报这个错误

Reproduction link / 重现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

4.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

@github-actions github-actions bot changed the title 使用workenable报错 An error is reported when you use WorkEnable Nov 15, 2024
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

1 participant