Skip to content

[question] import Plot in Node.js ERR_REQUIRE_ESM #2065

@dawadam

Description

@dawadam

Hi, thanks for the great library.
Is it possible to use it only with Node JS?
I try to import like this:

import Plot from '@observablehq/plot'

But the error is:

Error [ERR_REQUIRE_ESM]: require() of ES Module [...] not supported.

Instead change the require of [...] to a dynamic import() which is available in all CommonJS modules.

Why is normal import not working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions