unplugin / unplugin-icons

šŸ¤¹ Access thousands of icons as components on-demand universally.

Home Page:https://www.npmjs.com/package/unplugin-icons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

default import from "unplugin-icons/vite" get wrong type (since 0.14.2)

peter50216 opened this issue Ā· comments

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.

removing the "./dist/index.d.ts"

PR welcome!