shinokada / svelte-heros-v2

Hero Icons v2 for Svelte. You can select outline and solid icons using the variation props. Svlete-Heros support major CSS framework. You can add additional CSS using the `class` props.
https://svelte-heros-v2.codewithshin.com
Apache License 2.0
41 stars 3 forks source link

[BUG]: Seems v2 need v1? #1

Closed kuchaguangjie closed 2 years ago

kuchaguangjie commented 2 years ago

Description of the bug

use svelte-heros-v2, without v1, on start got error:

Cannot find module 'svelte-heros' imported from
'xxx/node_modules/.pnpm/flowbite-svelte@0.23.3/node_modules/flowbite-svelte/accordions/AccordionItem.svelte'

If v2 depends on v1 to work, then might should mention that in README.

But, IMO, v2 should not need v1, otherwise when import icon in .svelte file, it will show both icons, which may be a bit mess.

Steps To Reproduce

Additional Information

No response

shinokada commented 2 years ago

Svelte-Heros-v2 doesn't have Svelte-Heros dependencies. See package.json

You need to run pnpm i -D svelte-heros-v2. Please read the README

kuchaguangjie commented 2 years ago

Ah ha, it's flowbite-svelte depends on svelte-heros v1 ..

kuchaguangjie commented 2 years ago

Upgrade flowbite-svelte to ^0.26.3, then it worked. And, since the icon property of <Sidebar> is replaced by <svelte:fragment slot="icon"> in new version, a bit code refactoring is needed if upgrade from pretty old versions.

e.g


        <SidebarItem label="Home" href="/home">
          <svelte:fragment slot="icon">
            <Home variation="solid"/>
          </svelte:fragment>
        </SidebarItem>
kuchaguangjie commented 2 years ago

BTW, it should be pnpm i svelte-heros-v2 , not pnpm i -D svelte-heros-v2 I think. Since the readme use npm i svelte-heros-v2@latest, without -D.