Open FabianFrank opened 11 months ago
I am running into this issue as well on my wrapper for this package chakra-react-select
. I'm not sure this has anything to do with the change in #5626 though, as I'm having the same issue after reverting to v5.7.2
. I'm really not too familiar with the inner workings of module augmentation, is there something that changed with it when using moduleResolution: "bundler"
?
I'm also having the issue with node16
/nodenext
.
There seems to be an issue with module augmentation and the exports field in package.json added in https://github.com/JedWatson/react-select/pull/5559 and improved in https://github.com/JedWatson/react-select/pull/5626. Module augmentation as described at https://react-select.com/typescript#custom-select-props appears to no longer work since
react-select/dist/declarations/src/Select
appears to no longer be the path of theSelect
module when the exports field in package.json is used during module resolution. I was unfortunately not able to figure out what the new path is. Deleting the exports field from package.json fixes the issue and module augmentation works as expected again.The relevant section of building with tsc's
traceResolution
option enabled:Failing with exports field being present
Succeeding with exports field being deleted from react-select's package.json:
Seems like the root cause is
./dist/declarations/src/Select'
missing from the exports map: