Error: Cannot find module "react-select/dist/react-select.css"
See original GitHub issueI’m using the following code from the Usage
section to add a react-select component to my react js app component:
import Select from 'react-select';
Here is my code:
let options = [
{ value: 'value1', label: 'value 1' },
{ value: 'value2', label: 'value 2' },
{ value: 'value3', label: 'value 3' },
];
return (
<div>
<Select
name="item-selector"
value='value 1'
options={options} />
</div>
)
And unable to load it with the following console error:
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of
t
.
I’ve also tried to include CSS as per guide:
// Be sure to include styles at some point, probably during your bootstrapping
import 'react-select/dist/react-select.css';
and failed with a not found error in console. Please advise.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
After updating React-Select: Module not found: Can't resolve ...
I have manually checked react-select folder in node_modules couldn't find any react-select.css file. couldn't find any reference regarding this ...
Read more >Cannot find module 'caniuse-lite/data/features/css-unicode-bidi
Trying to run a next project for the first time, but i'm getting this error, and I can't find anything on google:
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address Locator\ ...
Read more >css-loader - npm
css -loader in the pre-rendering bundle. It doesn't embed CSS but only exports the identifier mappings. webpack.config.js. module.exports ...
Read more >Module not found: Can't resolve 'react/lib/React' - CodeRoad
node_modules/react-dom/lib/ReactCompositeComponent.js Module not found: Can't resolve ... ReactDebugTool.js:14 Uncaught Error: Cannot find module ...
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
I have the same problem, when I go to the dir node_modules/react-select/dist/ there is missing the react-select.css archive. And the official page the source link has a rotund error 404. What can I do? Besides make by myself the stylesheet?
@alexeystrakh The first error looks more like a problem with your component (is that component
t
?), but I guess you couldconsole.log(Select)
to confirm if it is null/undefined.Regarding the CSS, you could try
Or add one or more
../
to the front if your component is in a subfolder until you get to the parent folder where node_modules resides.