Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly incorrect main in package.json #42

Closed
daaku opened this issue Aug 26, 2020 · 3 comments · Fixed by #59
Closed

Possibly incorrect main in package.json #42

daaku opened this issue Aug 26, 2020 · 3 comments · Fixed by #59
Labels
documentation Improvements or additions to documentation

Comments

@daaku
Copy link

daaku commented Aug 26, 2020

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.

@daaku
Copy link
Author

daaku commented Aug 26, 2020

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

@Cweili
Copy link
Owner

Cweili commented Aug 27, 2020

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

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

@Cweili Cweili added the documentation Improvements or additions to documentation label Aug 27, 2020
@daaku
Copy link
Author

daaku commented Aug 27, 2020

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.

msanguineti added a commit to msanguineti/svelte-fa that referenced this issue Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants