-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support vitejs (ESM) #6
Comments
Sorry, I have no experience with vitejs. I have played with snowpack, but what I find is that different frontend tooling have their own problems. |
@Rysakov1986 did you ever end up getting this to work? I'd like to use this for a project, but I'm getting the same error and @ngyewch answer doesn't really help or give me much hope. It looks as if it's an active project though. |
Using this trick #3 (comment), I was able to run it OK on a svelte-kit project (which is powered by Vite). Since this summer, there was a lot of improvement on Vite's side to handle the different module flavors (CJS, ESM, UMD, etc.). I'm personally very impatient that the ecosystem will be mainly ESM-only (this topic is such a pain to handle !) |
The error sounds like you're doing: import LeafletMap from 'svelte-leafletjs' That should use the library's Anyway, try importing the named exports, e.g. import { LeafletMap, TileLayer } from 'svelte-leafletjs' |
The library still does not work even when following that guide.
|
Nevermind, it seems that I had a second import that was not using the |
@ngyewch, as the Svelte ecosystem moved mainly to using Vite as build tool, could you revisit this issue? |
@notramo Yeah, I have moved to Vite for other Svelte projects. I just have to find some time to migrate this project. Hopefully in the near future. |
A basic vite svelte project with
Quoting the link:
|
Help, i have error:
Uncaught SyntaxError: The requested module '/node_modules/leaflet/dist/leaflet-src.js?v=8128ddc4' does not provide an export named 'default'
The text was updated successfully, but these errors were encountered: