ngyewch / svelte-leafletjs

Svelte component for leaflet.
https://ngyewch.github.io/svelte-leafletjs/
MIT License
99 stars 18 forks source link

Missing exports condition #34

Closed siawkz closed 10 months ago

siawkz commented 11 months ago

Migrating to sveltekit 2.0 will show warning message below

WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

svelte-leafletjs@0.10.0

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition

jieter commented 10 months ago

I'm afraid this cleared the warning, but it results in a runtime error in svelte-leafletjs/dist/index.mjs:

index.mjs:362 Uncaught TypeError: Cannot read properties of undefined (reading '$$')
    at ui (index.mjs:362:50)
    at new da (index.mjs:15068:3)
    at ba (Map.svelte:76:48)
    at rn (Component.js:148:34)
    at new ka (Map.svelte:73:24)
    at Oa (App.svelte:42:66)
    at rn (Component.js:148:34)
    at new Za (App.svelte:32:26)
    at index.ts:6:13
Screenshot 2024-01-20 at 14 36 11
ngyewch commented 10 months ago

I've recently encountered this error too. This should be fixed in version 1.0.0-alpha.1

I'm in the process of updating the code to use Svelte 4 / Vite 5 / TypeScript 5.

Test code: https://github.com/ngyewch/svelte-leaflet-test/tree/svelte4