[BUG] Typescript types are not detected in nodeNext resolution environment
See original GitHub issueDescription
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
Issue Analytics
- State:
- Created a year ago
- Comments:22 (7 by maintainers)
Top Results From Across the Web
TypeScript module "Node16" does not resolve types of CJS ...
To expand on this, TypeScript 4.7.1-rc with nodenext module resolution is unable to resolve various NPM dependencies. See this example repo.
Read more >Documentation - Module Resolution - TypeScript
Module resolution is the process the compiler uses to figure out what an ... Finally, if the compiler could not resolve the module,...
Read more >TypeScript errors and how to fix them
error TS1055: Type ' AxiosPromise ' is not a valid async function return type in ... or 'nodenext', and the 'target' option is...
Read more >TS1343: The 'import.meta' meta-property is only allowed when ...
YOUR_VAR your test will pass without import.meta.env error ... resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6).
Read more >How we employed the new ECMAScript Module Support in ...
Why use ECMAScript modules (import) instead of CommonJS (require)? ... How to use nodenext in TypeScript? How to exempt files from the type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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