kbrgl / svelte-french-toast

🍞🥂 Buttery smooth toast notifications for Svelte
https://svelte-french-toast.vercel.app/
MIT License
838 stars 30 forks source link

Cannot find module 'typescript' Require stack: #2

Closed blazzjosh closed 2 years ago

blazzjosh commented 2 years ago

Trying to use the lib - but on import error says - node_modules/svelte-french-toast/components/ToastIcon.svelte - Cannot find module 'typescript'

blazzjosh commented 2 years ago

using with sveltekit...

kbrgl commented 2 years ago

Could you share some code that reproduces the bug, as well as the version of Svelte French Toast you’re using? Are you facing it during development or build, or both?

As a quick check, try installing Typescript and see if that fixes it.

blazzjosh commented 2 years ago

the import line triggers this error- import toast, {Toaster} from 'svelte-french-toast'

I am using "svelte-french-toast": "^1.0.2", also not using typescript for my sveltekit installation -

Error: LoaderIcon

451/node_modules/.pnpm/svelte-french-toast@1.0.2_svelte@3.48.0/node_modules/svelte-french-toast/components/LoaderIcon.svelte at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15

kbrgl commented 2 years ago

These errors aren't enough to debug the issue, unfortunately. I need code (a repository or CodeSandbox/Glitch) that reproduces it.

Try installing Typescript, regardless of whether you're using it. I'm wondering if maybe it needs to be added as a peer dependency.

kbrgl commented 2 years ago

Okay, found the issue. Looks like Svelte recommends that packages that use Typescript (like this one) be transpiled to regular JS. Fix is in the works.

kbrgl commented 2 years ago

Fixed in 1.0.3. Upgrade your svelte-french-toast installation to the latest version to solve the issue.