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

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

Closed
QC2168 opened this issue May 24, 2024 · 1 comment
Closed

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

QC2168 opened this issue May 24, 2024 · 1 comment
Labels
Outdate This issue is too old to be resolved

Comments

@QC2168
Copy link

QC2168 commented May 24, 2024

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

@Aarebecca Aarebecca added the Outdate This issue is too old to be resolved label Aug 23, 2024
Copy link

This issue has been closed because it has been outdate for a long time.
Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了
如果你仍然需要帮助,请创建一个新的 issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Outdate This issue is too old to be resolved
Projects
None yet
Development

No branches or pull requests

2 participants