JedWatson / JedWatson/react-select

Typescript error when importing "react-select/creatable" with moduleResolution "Node16" and "NodeNext"

Open
#5,474 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Error occurs in 5.6.0. It works in 5.5.2.

// From package.json
"typescript": "^4.8.4",
"react-select": "^5.6.0",
// Example.tsx
import Select from 'react-select/creatable';

With moduleResolution "Node16" or "NodeNext".

Cannot find module 'react-select/creatable' or its corresponding type declarations.

Still works with moduleResolution "Node" though, which I guess is most common.

This seems to only affect creatable. import Select from 'react-select' works with Node16 and NodeNext.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the package.json settings and the Example.tsx import shown in the report, then reproduce the failure using TypeScript 4.8.4 with moduleResolution set to Node16 and NodeNext. Compare the 5.6.0 and 5.5.2 package behavior, and consider the issue done when react-select/creatable resolves under both modes without breaking the existing react-select import.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.