dodge.js:1 Uncaught SyntaxError: The requested module './../../../../interval-tree-1d/interval-tree.js' does not provide an export named 'default' (at dodge.js:1:8)
After installing Plot with npm install @observablehq/plot, and importing like so:
import * as Plot from '@observablehq/plot';
I get the following console error when loading the page in the browser:
dodge.js:1 Uncaught SyntaxError: The requested module './../../../../interval-tree-1d/interval-tree.js' does not provide an export named 'default' (at dodge.js:1:8)
It appears that this is because a dependency "interval-tree-1d" does not have a default export, which "dodge.js" is attempting to import as IntervalTree.
Plot version: 0.6.17
I created an example app which demonstrates the problem:
https://github.com/SullivanMuse/observable-plot-bug
This is an issue with whatever packaging system you are using and not with Plot. We probably can’t help you debug, but good luck!
We just ran into the same problem and think it's related to how https://github.com/mikolalysenko/interval-tree-1d is used as an older CommonJS module, while Observable Plot uses more recent ES modules.
You can bridge the divide by configuring your Vite/Webpack/Rollup/etc build tool to also handle CommonJS modules.
Or ideally Observable Plot could wrap up this single-file dependency in a way that fits the current ESM approach.