BGW
BGW

Reputation: 75

Fixing Modals in Flowbite-Svelte, Basic example not working

I’m trying to get Svelte, Flowbite and TypeScript working together. I was specifically testing the ability to handle modal dialog boxes. I found in my first round of testing that I could bring modals up from a button but not from code. So I tried again.

To the index.svelte file I tried to import the modal code by entering:

<script>
    import { Modal } from 'flowbite-svelte'
</script>

Now when I run the site I get:

500

Cannot find module 'svelte-heros' imported from '/home/test/Projects/modal/node_modules/flowbite-svelte/accordions/AccordionItem.svelte'

Error: Cannot find module 'svelte-heros' imported from '/home/test/Projects/modal/node_modules/flowbite-svelte/accordions/AccordionItem.svelte' at viteResolve (file:///home/test/Projects/modal/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:50410:25) ...

I've used npm to install 'svelte-heros' but it didn't change anything.

What might I be doing wrong here and how do I fix it?

Upvotes: 0

Views: 1266

Answers (1)

oc7o
oc7o

Reputation: 74

I had the same issue.
Just run: npm install svelte-heros
It's listed in features here one click away.

🐙

Upvotes: 1

Related Questions