phosphor-icons / homepage

The homepage of Phosphor Icons, a flexible icon family for everyone
https://phosphoricons.com
MIT License
4.26k stars 101 forks source link

Support TypeScript "moduleResolution": "node16" #331

Closed omridevk closed 1 year ago

omridevk commented 1 year ago

Description

Description In TypeScript 4.7, along the property "module": "node16" that enables ESM features in TypeScript, there are new values for the property "moduleResolution": "node16" and "nodenext".

Problem Statement/Justification

The problem is that when using the icons in env with typescript configured to use "moduleResolution": "node16" will not work. see screen shot:

CleanShot 2023-09-04 at 11 29 46@2x

Expected behavior Import should work without throwing errors.

Workaround: either use "moduleResolution": "bundler" or use skipLibCheck: "true"

Both are not a good options in my opinion.

Thanks for the great library.

omridevk commented 1 year ago

The solution is to add .js/.mjs extension to all the files. ideally should be both to support all env.

rektdeckard commented 1 year ago

We've fixed this in 2.1.3 experimental release. If you have further questions specific to the React package, please make an issue over there!