Cweili / svelte-fa

Tiny FontAwesome component for Svelte

Home Page:https://cweili.github.io/svelte-fa/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibly incorrect main in package.json

daaku opened this issue · comments

I followed the instructions at https://svelte.dev/blog/svelte-and-typescript to setup a Svelte + TypeScript project, and used this library successfully. But the "svelte validate" step fails with this error:

Error: Cannot find module 'svelte-fa' or its corresponding type declarations. (ts)

(Note, it can't find the module, which is why it's an error. Other components don't have type declarations, but can be found, and that results in a warning, not an error.)

I think this is because main in package.json is set to a svelte file, which I don't believe is correct.

I changed main to dist/svelte-fa.js and it fixed it.

Maybe you need to build your project with rollup or webpack.

The main field in package.json is following official component svelte-virtual-list.

Maybe you need to build your project with rollup or webpack.

I'm using the official rollup template mentioned in the blog: https://svelte.dev/blog/svelte-and-typescript (without any changes to the rollup configuration).

The main field in package.json is following official component svelte-virtual-list.

I'll look into it, but it's possible that may also have it configured incorrectly to work with the newly shipped typescript support.