lucide-icons / lucide

Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons.
https://lucide.dev
ISC License
9.12k stars 385 forks source link

Latest release breaks with SvelteKit: `<Icon>` is not a valid SSR component #1536

Closed iolyd closed 9 months ago

iolyd commented 9 months ago

Package

Version

0.270.0

Browser

Operating system

Description

Using icons from the latest release is unfit for SvelteKit's SSR. Reverting to version 0.269.0 works.

Steps to reproduce

  1. Import any icon as a named export (import { User } from 'lucide-svelte')
  2. pnpm dev
  3. Observe logs

Checklist

erskingardner commented 9 months ago

+1 – I'm also having this same issue.

shirotech commented 9 months ago

dist/esm folder is missing in the new build

delight commented 9 months ago

bug is still in 0.271.0 ... 0.269.0 works

bfovez commented 9 months ago

The bug is still present in 0.274.0

Gerschtli commented 9 months ago

This bug was likely caused by https://github.com/lucide-icons/lucide/pull/1499

ericfennis commented 9 months ago

Working on it!

ericfennis commented 9 months ago

Sorry for the late response.

Released beta version on lucide-svelte@0.275.0-beta.0

Please have check if it now works.

npm install lucide-svelte@0.275.0-beta.0

Thanks to @JanTrichter for the fix in #1499

delight commented 9 months ago

lucide-svelte@0.275.0-beta.0 works for me

Gerschtli commented 9 months ago

For me too, thank you!

axeltaylor commented 9 months ago

Sorry for the late response.

Released beta version on lucide-svelte@0.275.0-beta.0

Please have check if it now works.

npm install lucide-svelte@0.275.0-beta.0

Thanks to @JanTrichter for the fix in #1499

Using astro and the integration with svelte works too, thank you!

delight commented 8 months ago

@ericfennis When are we going to see a release of lucide-svelte that fixes this problem ?

ericfennis commented 8 months ago

@delight Sorry we had some problems with duplicated alias/icon names. I just merged the fix #1555. All failed builds need to be released again. I will rerelease everything today. Including the fixes for lucide-svelte. I will post update when I'm done.

JayeshVP24 commented 8 months ago

Hey @ericfennis , its still broken in latest stable release. Any update on this?

delight commented 8 months ago

Hey @ericfennis , its still broken in latest stable release. Any update on this?

Are you sure about this? What version are you using? I ain't got no issues with the latest versions no more.

Wizzel1 commented 8 months ago

I am still getting this error with version 0.279.0

JayeshVP24 commented 8 months ago

Hey @ericfennis , its still broken in latest stable release. Any update on this?

Are you sure about this? What version are you using? I ain't got no issues with the latest versions no more.

umm nvm, Ig my package manager didn't update the cached package and even though it was 0.279.0 in package.json, it was using old ones. I use PNPM, so I simply ran pnpm up lucide-svelte --latest which resolved my issue. Don't know if this is pnpm specific issue or any package manager who uses cache mechanism. Thanks.

JayeshVP24 commented 8 months ago

I am still getting this error with version 0.279.0

try downgrading it to 0.269.0 then updating it using your package manager... ig you are using pnpm as well, run pnpm up lucide-svelte --latest after downgrading. This will update all cache's

Wizzel1 commented 8 months ago

I am still getting this error with version 0.279.0

try downgrading it to 0.269.0 then updating it using your package manager... ig you are using pnpm as well, run pnpm up lucide-svelte --latest after downgrading. This will update all cache's

Yeah seems to be working now, thanks!

OliverGilan commented 1 month ago

I'm getting the same issue with 0.376.0

OliverGilan commented 1 month ago

Downgrading to 0.372.0 fixes it. Something must have broken since then

ericfennis commented 1 month ago

@OliverGilan Hmm wierd, I will check!

aristelecom commented 1 month ago

I am using https://www.shadcn-svelte.com/docs and experiencing the same problem, I managed to solve it by downgrading to 0.372.0

Error when evaluating SSR module /node_modules/.pnpm/lucide-svelte@0.376.0_svelte@4.2.10/node_modules/lucide-svelte/dist/Icon.svelte: failed to import "@lucide/shared" |- Error: Cannot find module '@lucide/shared'

pnpm install lucide-svelte@0.372.0

This worked