New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error "'default' is not exported by <package>" when importing in Svelte file #370
Comments
I'm transferring this to the repo for the REPL. I haven't really dug into this a ton, but it looks like the code the REPL is getting from your library (https://unpkg.com/d3-weighted-voronoi@1.1.3/build/d3-weighted-voronoi.js) is an UMD built version. The REPL isn't using the ESM version in your package, I'm guessing because you refer to it only as Neither |
Thanks for your comment. |
I would recommend changing from This FAQ about packaging may also be helpful to you: https://kit.svelte.dev/faq#packages |
@benmccann I'm currently looking at this cjs/esm/umd and hybrid way of delivering/providing packages. As the package I'm maintaining is a plugin for the d3.js package/environment (https://d3js.org/, https://github.com/d3/d3), I will follow the same path as d3.js : going from an umd distribution to an esm one (d3/d3#3501). Apparently, this move has been done in mid 2021, and made available in the d3@7. |
Describe the bug
Hello,
I made and maintain the d3-voronoi-map package (https://github.com/Kcnarf/d3-voronoi-map). Also, I'm not a Svelte user.
An issue (Kcnarf/d3-voronoi-map#16) reports that the d3-voronoi-map package, when imported with Svelte (at least into svelte.dev), raises the error
ERROR 'default' is not exported by https://unpkg.com/d3-array@3.2.0/src/index.js, imported by https://unpkg.com/d3-weighted-voronoi@1.1.3/build/d3-weighted-voronoi.js
.I did some explorations (resumed in Kcnarf/d3-voronoi-map#16 (comment)). For short:
import {extent as d3Extent} from d3-array
, without any default import.Thanks for your feedbacks/highlights/comments/help.
PS: the severity of this issue is not appropriate, but don't find any good one.
Reproduction
https://svelte.dev/repl/d3847fb950b54cdca2868aaab2bd7872?version=3.49.0
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: