Fixing Modals in Flowbite-Svelte, Basic example not working
21:37 05 Aug 2022

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:


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?

typescript modal-dialog svelte vite flowbite