chakra-react-select: [BUG] Typescript types are not detected in nodeNext resolution environment
Description
When using nodeNext module resolution in typescript, react-chakra-select types are not detected. Because when "exports" is present, "types" at root level supposed to be ignored
Solution is to add
“types”: “dist/types/index.d.ts”
to package.json “exports” object after “default”
chakra-react-select Version
4.2.2
Link to Reproduction
No response
TypeScript?
- Yes I use TypeScript
Steps to reproduce
- Create tsconfig with
"moduleResolution": "NodeNext", - Include “chaka-react-select”
- Try to typecheck
Operating System
- macOS
- Windows
- Linux
- iOS/iPadOS
- Android
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (7 by maintainers)
Haha yep, I tested it myself in a test app first and it seemed to do the trick so I published quick. Didn’t want to leave a bug which breaks the whole package around for longer than I had to 😅
Thanks for confirming for me though!
Hello, this update broke my Next.js project (no Typescript). After upgrading to 4.2.3 I am getting
If I remove from node_modules (package.json) the following line, then everything works fine
"types": "./dist/types/index.d.ts"I have tried to remove completely node_modules and yarn.lock and install again and the problem remains…Thanks in advance
I confirm replacing exports with
fixes the bug 😃
So, I would say it’s OK to release the new npm (4.2.4) Thank you everyone for the prompt reply. Good job !!!
Thanks for the quick feedback @itsam @Nithur-M @luastoned I pushed a fix for this in
v4.2.4.Honestly, it’s my fault for not doing much testing, didn’t expect this to completely break the package for others.
Thanks for the fix recommendation @luastoned, helped me get a new version out quick!
Well, actually this is a general comment. I am not using TS in my project at all. Everything worked normally until I 've upgraded to 4.2.3. Quick search led me to this issue, and I tried to remove the line I mentioned above and everything worked again. So currently, version 4.2.3 is broken for non-TS next.js projects (cannot tell about TS)
Thank you for your great work and time 😃
Seems to be smooth. many thanks for quick turnaround
Should be published now in
v4.2.3, let me know if you’re still running into any issues!ok cool, yes I can add that! Thanks for bringing this to my attention