therufa / mdi-vue

Material design icons for vue.js
https://www.npmjs.com/package/mdi-vue
MIT License
88 stars 13 forks source link

Can't import in Vite vue 3 typescript #68

Closed SuperCuber closed 2 years ago

SuperCuber commented 2 years ago

I installed like in the example, and have the following in my package.json:

    "@mdi/js": "^6.3.95",
    "mdi-vue": "^3.0.8",

Then I put this in my src/main.ts:

import mdiVue from "mdi-vue/v3";
import mdijs from "@mdi/js";

The mdijs line works fine, but typescript complains "could not find a declaration file" for mdi-vue, and when I try to run it says import not found: default in the browser console.

Am I doing something wrong?

therufa commented 2 years ago

hi @SuperCuber, thanks for reporting this issue. I think the type declaration for the lib is not loaded by the typescript compiler. As far as I understand the docs, the folder name in this project is wrong. In case you have some spare time on your hand you're invited to help me with this investigation :)

SuperCuber commented 2 years ago

I'm kind of a typescript noob so I don't think I would contribute much :P