esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

Failed to import - d3

Open mbostock opened this issue 1 year ago • 1 comments

Failing module

  • GitHub: https://github.com/d3/d3
  • npm: https://npmjs.com/package/d3
import {schemeObservable10} from "https://esm.sh/d3";

Error message

After onload I got this:

Uncaught SyntaxError: The requested module 'https://esm.sh/d3' does not provide an export named 'schemeObservable10' (at test.html:4:9)

Additional info

The built version of d3 currently resolves the d3-scale-chromatic dependency to 3.0.0, but the latest release of d3-scale-chromatic is 3.1.0.

https://esm.sh/[email protected]

  • esm.sh version: N/A
  • Browser version: N/A

mbostock avatar Mar 13 '24 14:03 mbostock

Unfortunately this is still an issue and extends to other packages that pull in d3.

For d3 itself a workaround appears to be to append a cache breaker, e.g. https://esm.sh/[email protected]?foo. In another case I was able to circumvent the cached dependency by adding ?bundle-deps: https://esm.sh/gh/observablehq/[email protected]?bundle-deps&dev

mootari avatar May 24 '24 09:05 mootari