[V5] 使用自定义注册节点后控制台报错Error [ERR_REQUIRE_ESM] #6325
Unanswered
chris-deng
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
使用https://g6-next.antv.antgroup.com/zh/examples/layout/dagre#antv-dagre-combo这个案例,将节点替换成自定义节点活动图
控制台报错:
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/test-topoly/node_modules/d3-color/src/index.js from /Users/test-topoly/node_modules/@antv/g-lite/dist/index.js not supported.
Instead change the require of /Userstest-topoly/node_modules/d3-color/src/index.js in /Users/test-topoly/node_modules/@antv/g-lite/dist/index.js to a dynamic import() which is available in all CommonJS modules.
GraphOptions:
自定义节点的注册:参考https://g6-next.antv.antgroup.com/examples/element/custom-node/#g2-activity-chart 这个活动图
求帮忙看看怎么解决这个报错
如果不使用g2的自定义节点,则不会报错,但是docker镜像打包后运行,页面报错:
vendor.a5ed4250.js:27 TypeError: Cannot read properties of undefined (reading 'constant')
有没有遇到相同问题的同学
Beta Was this translation helpful? Give feedback.
All reactions