default import from "unplugin-icons/vite" get wrong type (since 0.14.2)
peter50216 opened this issue Ā· comments
Peter Shih commented
import Icons from "unplugin-icons/vite";
Icons();
gives the following error in 0.14.2:
a.ts:2:1 - error TS2349: This expression is not callable.
Type 'UnpluginInstance<Options>' has no call signatures.
2 Icons();
~~~~~
Which works fine in 0.14.1
Looks like this is introduced by 1932a83 package.json
change, and the import resolves to dist/index.d.ts
instead of dis/vite.d.ts
.
I can solve the issue locally by removing the "./dist/index.d.ts",
line in typesVersions
field, but I don't know if that will break any other usage.
Anthony Fu commented
removing the "./dist/index.d.ts"
PR welcome!