Skip to content

next.js 使用 antv g2@5.0.0-beta.4 报错 Error [ERR_REQUIRE_ESM] #4493

@Jackeriss

Description

@Jackeriss

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升级导致的。
相似问题:
FormidableLabs/victory#1957

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions