antvis/G6

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Vitepress build Error [ERR_REQUIRE_ESM]: require() of ES Module #5765

QC2168 posted onGitHub

Describe the bug

I use the G6.TreeGraph module, which works on dev, and I get errors when I build

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\project\shopping\node_modules\.pnpm\d3-interpolate@3.0.1\node_modules\d3-interpolate\src\index.js from E:\project\shopping\node_modules\.pnpm\@antv+g-base@0.5.16\node_modules\@antv\g-base\lib\animate\timeline.js not supported.
Instead change the require of index.js in E:\project\shopping\node_modules\.pnpm\@antv+g-base@0.5.16\node_modules\@antv\g-base\lib\animate\timeline.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g-base@0.5.16\node_modules\@antv\g-base\lib\animate\timeline.js:5:24)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g-base@0.5.16\node_modules\@antv\g-base\lib\abstract\canvas.js:7:18)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g-base@0.5.16\node_modules\@antv\g-base\lib\index.js:17:16)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-core@0.8.24\node_modules\@antv\g6-core\lib\interface\behavior.js:8:14)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-core@0.8.24\node_modules\@antv\g6-core\lib\util\base.js:8:17)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-core@0.8.24\node_modules\@antv\g6-core\lib\graph\controller\view.js:9:13)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-core@0.8.24\node_modules\@antv\g6-core\lib\graph\controller\index.js:31:36)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-core@0.8.24\node_modules\@antv\g6-core\lib\graph\graph.js:15:19)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-core@0.8.24\node_modules\@antv\g6-core\lib\index.js:94:37)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6-pc@0.8.24_@antv+g6@4.8.24\node_modules\@antv\g6-pc\lib\index.js:101:15)
    at Object.<anonymous> (E:\project\shopping\node_modules\.pnpm\@antv+g6@4.8.24\node_modules\@antv\g6\lib\index.js:11:37)
    at async build (file:///E:/project/shopping/node_modules/.pnpm/vitepress@1.2.2_@algolia+client-search@4.22.1_@types+node@20.12.11_async-validator@4.2.5_axio_vnfibxwjskcyfxbpm5lhadvxse/node_modules/vitepress/dist/node/serve-BwR5EPUJ.js:46734:24) {
  code: 'ERR_REQUIRE_ESM'
}

Your Example Website or App

https://github.com/QC2168/vitepress-g6-build-error

Steps to Reproduce the Bug or Issue

  1. pnpm install
  2. pnpm build

Expected behavior

It should work properly

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome

Additional context

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests