antvis/G2







The issue has been closed
next.js 使用 antv g2@5.0.0-beta.4 报错 Error [ERR_REQUIRE_ESM] #4493
Jackeriss posted onGitHub
next.js 使用 antv g2@5.0.0-beta.4 报错:
Error [ERR_REQUIRE_ESM]: require() of ES Module /xxx/node_modules/.pnpm/d3-hierarchy@3.1.2/node_modules/d3-hierarchy/src/index.js from /xxx/node_modules/.pnpm/@antv+g2@5.0.0-beta.4/node_modules/@antv/g2/lib/mark/utils.js not supported.
Instead change the require of index.js in /xxx/node_modules/.pnpm/@antv+g2@5.0.0-beta.4/node_modules/@antv/g2/lib/mark/utils.js to a dynamic import() which is available in all CommonJS modules.
应该是d3-interpolate升级导致的。 相似问题: https://github.com/FormidableLabs/victory/issues/1957