fix(pkg): add types to package.json#exports#126
Conversation
agilgur5
left a comment
There was a problem hiding this comment.
Thanks for the fix!
Do you have a reproduction for this? What version of TS are you on?
The types work fine for me and TS should fallback to the existing typings field. Although I also deep-dived the TS docs on this recently and there are some ambiguities. Being able to reproduce would be quite helpful
|
Sure thing! Happening for me with Typescript v5.7.3 & v5.8.2 https://github.com/daltonkyemiller/repro-react-signature-canvas-126 CleanShot.Mar.10.2025.mp4 |
|
Thanks, I'll take a look soon! Did you get any CLI errors also? Or only in the IDE? |
types to package.json#exports
|
Thanks for the repro, I see what the issue is now! It appears that my base Both taybenlor/runno#323 (comment) and your repro use the newer I'll merge this in now, but give me a bit to update some other pieces and make a new release Footnotes |
types to package.json#exportstypes to package.json#exports
This comment was marked as resolved.
This comment was marked as resolved.
|
This and the follow-up fix in #131 have been released in |
In TS 4.7+, when using newer `moduleResolution` options such as `node16`, `bundler`, and `nodenext`, the types _must_ be defined in `package.json#exports` to be properly detected

Getting an error when types aren't defined in the
exports.This is fixed after adding
typestoexports.