question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module "react-select/dist/react-select.css"

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
Alejandrokbocommented, Oct 15, 2018

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?

4reactions
MrLeebocommented, Mar 10, 2017

@alexeystrakh The first error looks more like a problem with your component (is that component t?), but I guess you could console.log(Select) to confirm if it is null/undefined.

Regarding the CSS, you could try

import 'node_modules/react-select/dist/react-select.css';

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found