xiphux / svimg

Svelte image component with image preprocessing and lazy loading
ISC License
243 stars 15 forks source link

Doesn't work with sveltekit 1.27.7 #51

Closed ErikSandquist closed 11 months ago

ErikSandquist commented 11 months ago

After updating to sveltekit 1.27.7 i get the error: image

And in the console: [vite] Error when evaluating SSR module /src/lib/AudioDemo.svelte: failed to import "/node_modules/svimg/src/Image.svelte"

This is with Svimg 4.0.0

xiphux commented 11 months ago

Can you double check that you're using an up to date svelte / vite-plugin-svelte? The customElement option is new in Svelte 4.

ErikSandquist commented 11 months ago

Was missing svelte 4, but after I updated I now get the error:

SyntaxError: The requested module '/node_modules/.vite/deps/svimg.js?v=331bcb0f' does not provide an export named 'default' (at Cart.svelte:4:9)
handleError @ app.js:42

And the code found at Cart.svelte is just:

import Image from 'svimg';
xiphux commented 11 months ago

Please refer to the README and the CHANGELOG for 4.0.0. The entry point for the component changed in svimg 4.0.0.

ErikSandquist commented 11 months ago

Thank you for the help. That slipped by when updating.