-
-
Notifications
You must be signed in to change notification settings - Fork 143
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 when importing npm package: 'x' is not exported #848
Comments
As far as I can tell, there are two places where this specific issue could be attacked. I think they would both be reasonable new features for the REPL, but I don't know which is more likely to be more helpful or easier. One the one hand, the in-browser bundler code for CommonJS->ESM conversion doesn't support exposing keys on the On the other hand, unpkg is resolving (redirecting) https://unpkg.com/dequal/lite to https://unpkg.com/[email protected]/lite/index.js (the CJS version) as opposed to https://unpkg.com/[email protected]/lite/index.mjs (the ESM version). I don't know whether it's using the module's |
Would it be possible to leverage Skypack's Example: https://svelte.dev/repl/00b452b61a424de9b818e79bf029f37f?version=3.55.0
The error's source: https://unpkg.com/@iconify/[email protected]/dist/functions.js At the bottom of that file, I can see that Skypack solves this by converting all files in a module to use ES2020. Here's the same module in Skypack: https://cdn.skypack.dev/@iconify/svelte@latest/dist=es2020 It's currently not possible to do this in the Svelte REPL: <script>
import Icon from "https://cdn.skypack.dev/@iconify/svelte@latest/dist=es2020";
</script> But if I could, this would help with CJS-to-ESM conversions. Or, the REPL can switch from Unpkg to Skypack. |
This repl is awesome! ❤️ I have a small issue.
https://svelte.dev/repl/820b649c9edd4acd9e9b33d727dd3414?version=3.42.6
Looking at the contents of https://unpkg.com/[email protected]/lite/index.js
dequal
is exported though on the last line.Any idea what's going on here?
The text was updated successfully, but these errors were encountered: