-
-
Notifications
You must be signed in to change notification settings - Fork 127
fix(pkg): add types to package.json#exports
#126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pkg): add types to package.json#exports
#126
Conversation
agilgur5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.