Skip to content

ERR_REQUIRE_ESM when importing WebGL renderer #84

@brianlove

Description

@brianlove

I'm trying to add a Trellis-based graph within a Nuxt/Vue website. When I try using the most recent 0.6.1 release I get the error described in #81 (this also happens in the 0.7.0 RCs). However, when I try 0.6.0 I get the following ESM error instead:

[Vue Router warn]: uncaught error during route navigation:
Error [ERR_REQUIRE_ESM]: require() of ES Module /PROJECT_PATH/node_modules/d3-color/src/index.js from /PROJECT_PATH/node_modules/@sayari/trellis/renderers/webgl/utils.js not supported.
Instead change the require of index.js in /PROJECT_PATH/node_modules/@sayari/trellis/renderers/webgl/utils.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/PROJECT_PATH/node_modules/@sayari/trellis/renderers/webgl/utils.js:4:18)
    at Object.<anonymous> (/PROJECT_PATH/node_modules/@sayari/trellis/renderers/webgl/node.js:66:15)
    at Object.<anonymous> (/PROJECT_PATH/node_modules/@sayari/trellis/renderers/webgl/index.js:52:14) {
  code: 'ERR_REQUIRE_ESM'
}

Interestingly, version 0.6.0 works just fine in another (Svelte-based) project that I created last year (originally 0.4.3, but recently updated).

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