observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.16k stars 171 forks source link

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

Closed dawadam closed 2 months ago

dawadam commented 2 months ago

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?