jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
555 stars 59 forks source link

vue 2 with typescript incorrect types definition #82

Closed haegemonia76 closed 1 year ago

haegemonia76 commented 1 year ago

Currently migrating a huge project from vue 2.6.x / nuxt 2 / webpack 5 to vue 2.6.x / nuxt 2 / vite / typescript and I found your svg loader working pretty well, thank you :) But I tripped on some annoying typescript error as FunctionnalComponent<> is non existant in vue 2.

I saw in your package.json you support vue from 2.5 to vue 3 but vue 2.5+ does not work with these types :/

I came across FunctionalComponentOptions but i'm not sure if it's the same behaviour and if it's ok to use this typing instead ?

gkatsanos commented 1 year ago

Hey, not 100% sure but you probably need Vue3 to make it work. I'll close this for now as it's been while, please reopen with a reproduction link if you're still facing an issue