Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Unable to import typescript interfaces #146

Closed
jnordberg opened this issue Jul 23, 2020 · 3 comments
Closed

Unable to import typescript interfaces #146

jnordberg opened this issue Jul 23, 2020 · 3 comments

Comments

@jnordberg
Copy link

jnordberg commented Jul 23, 2020

Using this template with typescript I'm getting "name-is-not-exported-by-module" errors when trying to import interfaces from external modules. Was able to solve it by downgrading the rollup commonjs plugin as suggested in this issue: pyoner/svelte-typescript#23 Actually not, that was a red herring. Downgrading caused my build to hang indefinitely and a stale bundle was served making it look like it worked..

@benmccann
Copy link
Member

@jnordberg
Copy link
Author

Thanks, that worked. When using the standard way of importing types in Vue et all it works fine. Is this a fundamental limitation of svelt or something that could be improved?

@benmccann
Copy link
Member

I'm really not sure. I think type would be the preferred way to do it in either case, but it does seem funny that it works differently in Svelte

I think that this is related to https://github.com/sveltejs/svelte-preprocess. If you want to be a baller you could ask over in that repo why that is and then update the TypeScript FAQ: https://github.com/sveltejs/svelte/blob/master/site/content/faq/500-what-about-typescript-support.md

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants