tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.04k stars 1.26k forks source link

Typescript declaration files #771

Closed Tanner-Scadden closed 1 year ago

Tanner-Scadden commented 1 year ago

2.0+ is missing typescript declaration files. Will this be added back in soon?

RobinMalfait commented 1 year ago

Hey! Thank you for your question! Much appreciated! 🙏

The TypeScript declaration files are definitely there, as you can see here:

Here is a screenshot from my editor: image

Make sure you have installed the @heroicons/react or @heroicons/vue package. You can also try to nuke the node_modules folder and reinstall. If that doesn't work then you can try to restart your tsserver process. If all of that doesn't work, then I would like to ask you to open a new issue with a reproduction repo attached so that we can take a look.

artdevgame commented 1 year ago

I think it's when you reference '@heroicons/react/outline', which vscode implies is an option, it shows the red squiggly line.

ibraelillo commented 1 year ago

I'm also having issues because declaration file is missing.

RobinMalfait commented 1 year ago

If you are using v2 of Heroicons, then including @heroicons/react/outline won't work (You will get a runtime error telling you to use v1 because that import only works there).

If you are on v2 and use the correct imports:

Then TypeScript will and should work since they come with TypeScript definitions as mentioned here: https://github.com/tailwindlabs/heroicons/issues/771#issuecomment-1229156206