epicweb-dev / client-hints

Eliminate a flash of incorrect content by using client hints
https://github.com/epicweb-dev/client-hints
265 stars 11 forks source link

Add explicit extension to all imports #8

Closed gustavopch closed 3 months ago

gustavopch commented 7 months ago

That's necessary for full compatibility with ESM in TypeScript when using "moduleResolution": "NodeNext".

When the import doesn't have the extension, TypeScript can't properly resolve it:

image

After I manually add the extension, you can see now it resolves correctly:

image

TypeScript doesn't modify the paths used in the imports when compiling, so it's really a matter of adding the extension to all imports in the source code.

kentcdodds commented 7 months ago

Yes, you're right. This is the correct thing to do in native ESM as well. I would welcome a PR to fix this!

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 1.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: