-
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
how to setup on sveltekit? #3
Comments
TLDR:
|
Instead of importing the library in import { LeafletMap } from 'svelte-leafletjs?client' |
@timwis was a bit sparingly with his informations. After installing vite-plugin-iso-import, you need to do three things:
|
Would someone happen to know how to install with plain Svelte + vitejs? |
I'm getting a 500 window is not defined.....does anyone know how to solve this,cant make it run |
@Erildo I'm also getting window not defined error, I think Leaflet 1.9.0 will resolve this in coming weeks: ...And maybe the enhanced ESM support added will obviate the need to implement one or more (or all) of the other methods listed on this thread? i.e. |
I have a serverless (sst) project, using svelte for the frontend. It uses vite to deal with the frontend stuff. (see https://sst.dev/examples/how-to-create-a-svelte-app-with-serverless.html for the general setup, as a side note - I really liked the experience so far) I tried the mimic the approach as proposed by @dritter in the comment above, but to no avail. When I try to import leaflet, it complains about having no default import, when I add the ?client, I get
Any ideas? (Sorry, I'm rather new to vite/svelte) Thanks! |
I've got this to run, I noticed that this line:
should be
Other than that you need to install https://github.com/bluwy/vite-plugin-iso-import if the |
thanks @dritter , this saved my day, |
Use workaround on ngyewch/svelte-leafletjs#3 (comment) to get working in svelte kit
could you guide me how to setup on sveltekit?
The text was updated successfully, but these errors were encountered: