-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Svelte and TS errors when importing svgs #25
Comments
I have no idea of your setup, but try giving this a try. Change the
Let me know if that helps? |
This most likely, partly, solves #25 Also give better suggestions for type defs with proper Svelte typed component def
I've made a new release where I think this issue may be solved. Feel free to re-open this issue if the problem persists. |
Hi @tcherokee. Perhaps you'r on an old version of SvelteKit? Either upgrade or change the type to Hope that helps. |
I'm not sure why, but putting the Experimenting a little, I found putting it in a .d.ts beside the .svelte file works. In my case this is my global Of course this is unlikely to be caused by an issue in this library, but does anyone know the cause, and do the docs here need to be updated? |
Tanks for the message @coldino, very much appreciated. In my personal opinion there are too many moving parts when it comes to a project and how TS and type-resolution etc is setup, that it feels more or less like a guessing-game getting all these things to work 😂 Now, if anyone makes a PR with more sensible defaults, I'll be the first to merge it |
Also looking for solutions. @coldino your workaround does work, indeed. |
It seems Svelte doesn't like this being in app.d.ts, and I've found there's no problem having in as svg.d.ts. See #25 for reference
i created the |
i installed with
|
@Porter-smith Did you try this? https://github.com/poppa/sveltekit-svg/#typescript |
Oh I see ! I didn't realize it had that thank you ! |
If I use ?component I get this:
If I remove ?component I get this:
Also had to import the vite Plugin type to make this plugin work. Everything works now despite these errors, but how can I fix them? Thanks for you help!
The text was updated successfully, but these errors were encountered: