Module not found: Error: Can't resolve 'react-select' with typescript
module import is not working for me. I'm tried different solutions provided from stack overflow and other.
These are steps I'm follow the react-select
npm install --save @types/react-select
import the module like this
import Select from "react-select"
but I got the error
Module not found: Error: Can't resolve 'react-select'
import * as React from "react";
import ReactSelect from 'react-select'
export class Select extends extends React.Component<someProps>
render()
return(
<Select id="color" options=options />
);
But I can't find the way to fixed this.
reactjs typescript react-select
|
show 6 more comments
module import is not working for me. I'm tried different solutions provided from stack overflow and other.
These are steps I'm follow the react-select
npm install --save @types/react-select
import the module like this
import Select from "react-select"
but I got the error
Module not found: Error: Can't resolve 'react-select'
import * as React from "react";
import ReactSelect from 'react-select'
export class Select extends extends React.Component<someProps>
render()
return(
<Select id="color" options=options />
);
But I can't find the way to fixed this.
reactjs typescript react-select
1
Where does this error occur:Module not found: Error: Can't resolve 'react-select'
? Is it shown by TS in editor or by JS in runtime?
– Nurbol Alpysbayev
Nov 13 '18 at 11:22
1
Did you run the bundling process after installing the package? Doesnpm list --depth=0
showsreact-select
?
– Nurbol Alpysbayev
Nov 13 '18 at 11:26
1
You didn't answer about bundling though
– Nurbol Alpysbayev
Nov 13 '18 at 11:32
1
Every time you make some edits to your code, as well as when installing a package, you have to rebuild (re-bundle) your project. So if you use Webpack (npm run build
), you should run it. If you use create-react-app, you should runnpm start
– Nurbol Alpysbayev
Nov 13 '18 at 11:39
1
Sorry I ran out of ideas. My guesses is something is wrong with your build process, or maybe... there's a hidden character in the module name (I would retype it by hand) :D
– Nurbol Alpysbayev
Nov 13 '18 at 11:47
|
show 6 more comments
module import is not working for me. I'm tried different solutions provided from stack overflow and other.
These are steps I'm follow the react-select
npm install --save @types/react-select
import the module like this
import Select from "react-select"
but I got the error
Module not found: Error: Can't resolve 'react-select'
import * as React from "react";
import ReactSelect from 'react-select'
export class Select extends extends React.Component<someProps>
render()
return(
<Select id="color" options=options />
);
But I can't find the way to fixed this.
reactjs typescript react-select
module import is not working for me. I'm tried different solutions provided from stack overflow and other.
These are steps I'm follow the react-select
npm install --save @types/react-select
import the module like this
import Select from "react-select"
but I got the error
Module not found: Error: Can't resolve 'react-select'
import * as React from "react";
import ReactSelect from 'react-select'
export class Select extends extends React.Component<someProps>
render()
return(
<Select id="color" options=options />
);
But I can't find the way to fixed this.
reactjs typescript react-select
reactjs typescript react-select
edited Nov 13 '18 at 11:18
Namindu Sanchila
asked Nov 13 '18 at 11:08
Namindu SanchilaNamindu Sanchila
61110
61110
1
Where does this error occur:Module not found: Error: Can't resolve 'react-select'
? Is it shown by TS in editor or by JS in runtime?
– Nurbol Alpysbayev
Nov 13 '18 at 11:22
1
Did you run the bundling process after installing the package? Doesnpm list --depth=0
showsreact-select
?
– Nurbol Alpysbayev
Nov 13 '18 at 11:26
1
You didn't answer about bundling though
– Nurbol Alpysbayev
Nov 13 '18 at 11:32
1
Every time you make some edits to your code, as well as when installing a package, you have to rebuild (re-bundle) your project. So if you use Webpack (npm run build
), you should run it. If you use create-react-app, you should runnpm start
– Nurbol Alpysbayev
Nov 13 '18 at 11:39
1
Sorry I ran out of ideas. My guesses is something is wrong with your build process, or maybe... there's a hidden character in the module name (I would retype it by hand) :D
– Nurbol Alpysbayev
Nov 13 '18 at 11:47
|
show 6 more comments
1
Where does this error occur:Module not found: Error: Can't resolve 'react-select'
? Is it shown by TS in editor or by JS in runtime?
– Nurbol Alpysbayev
Nov 13 '18 at 11:22
1
Did you run the bundling process after installing the package? Doesnpm list --depth=0
showsreact-select
?
– Nurbol Alpysbayev
Nov 13 '18 at 11:26
1
You didn't answer about bundling though
– Nurbol Alpysbayev
Nov 13 '18 at 11:32
1
Every time you make some edits to your code, as well as when installing a package, you have to rebuild (re-bundle) your project. So if you use Webpack (npm run build
), you should run it. If you use create-react-app, you should runnpm start
– Nurbol Alpysbayev
Nov 13 '18 at 11:39
1
Sorry I ran out of ideas. My guesses is something is wrong with your build process, or maybe... there's a hidden character in the module name (I would retype it by hand) :D
– Nurbol Alpysbayev
Nov 13 '18 at 11:47
1
1
Where does this error occur:
Module not found: Error: Can't resolve 'react-select'
? Is it shown by TS in editor or by JS in runtime?– Nurbol Alpysbayev
Nov 13 '18 at 11:22
Where does this error occur:
Module not found: Error: Can't resolve 'react-select'
? Is it shown by TS in editor or by JS in runtime?– Nurbol Alpysbayev
Nov 13 '18 at 11:22
1
1
Did you run the bundling process after installing the package? Does
npm list --depth=0
shows react-select
?– Nurbol Alpysbayev
Nov 13 '18 at 11:26
Did you run the bundling process after installing the package? Does
npm list --depth=0
shows react-select
?– Nurbol Alpysbayev
Nov 13 '18 at 11:26
1
1
You didn't answer about bundling though
– Nurbol Alpysbayev
Nov 13 '18 at 11:32
You didn't answer about bundling though
– Nurbol Alpysbayev
Nov 13 '18 at 11:32
1
1
Every time you make some edits to your code, as well as when installing a package, you have to rebuild (re-bundle) your project. So if you use Webpack (
npm run build
), you should run it. If you use create-react-app, you should run npm start
– Nurbol Alpysbayev
Nov 13 '18 at 11:39
Every time you make some edits to your code, as well as when installing a package, you have to rebuild (re-bundle) your project. So if you use Webpack (
npm run build
), you should run it. If you use create-react-app, you should run npm start
– Nurbol Alpysbayev
Nov 13 '18 at 11:39
1
1
Sorry I ran out of ideas. My guesses is something is wrong with your build process, or maybe... there's a hidden character in the module name (I would retype it by hand) :D
– Nurbol Alpysbayev
Nov 13 '18 at 11:47
Sorry I ran out of ideas. My guesses is something is wrong with your build process, or maybe... there's a hidden character in the module name (I would retype it by hand) :D
– Nurbol Alpysbayev
Nov 13 '18 at 11:47
|
show 6 more comments
2 Answers
2
active
oldest
votes
You have an error:
npm install --save @type/react-select
instead of
npm install --save @types/react-select
Also I would recommend to use --save-dev
instead of --save
because you don't need typings in production.
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
add a comment |
I found the issue having here. Issue is both @types/react-select
and react-select
added to the package.json
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53279686%2fmodule-not-found-error-cant-resolve-react-select-with-typescript%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have an error:
npm install --save @type/react-select
instead of
npm install --save @types/react-select
Also I would recommend to use --save-dev
instead of --save
because you don't need typings in production.
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
add a comment |
You have an error:
npm install --save @type/react-select
instead of
npm install --save @types/react-select
Also I would recommend to use --save-dev
instead of --save
because you don't need typings in production.
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
add a comment |
You have an error:
npm install --save @type/react-select
instead of
npm install --save @types/react-select
Also I would recommend to use --save-dev
instead of --save
because you don't need typings in production.
You have an error:
npm install --save @type/react-select
instead of
npm install --save @types/react-select
Also I would recommend to use --save-dev
instead of --save
because you don't need typings in production.
answered Nov 13 '18 at 11:15
Nurbol AlpysbayevNurbol Alpysbayev
4,2811330
4,2811330
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
add a comment |
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar sorry for that I'm used the npm install --save @types/react-select it's same as you provided. In the questions it should be edited.
– Namindu Sanchila
Nov 13 '18 at 11:18
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
yar I had use environment too. but this snippets for the example how im used it
– Namindu Sanchila
Nov 13 '18 at 11:19
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
It's also correct in the code. only error I got is Module not found: Error: Can't resolve 'react-select'
– Namindu Sanchila
Nov 13 '18 at 11:23
add a comment |
I found the issue having here. Issue is both @types/react-select
and react-select
added to the package.json
add a comment |
I found the issue having here. Issue is both @types/react-select
and react-select
added to the package.json
add a comment |
I found the issue having here. Issue is both @types/react-select
and react-select
added to the package.json
I found the issue having here. Issue is both @types/react-select
and react-select
added to the package.json
answered Nov 15 '18 at 8:21
Namindu SanchilaNamindu Sanchila
61110
61110
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53279686%2fmodule-not-found-error-cant-resolve-react-select-with-typescript%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Where does this error occur:
Module not found: Error: Can't resolve 'react-select'
? Is it shown by TS in editor or by JS in runtime?– Nurbol Alpysbayev
Nov 13 '18 at 11:22
1
Did you run the bundling process after installing the package? Does
npm list --depth=0
showsreact-select
?– Nurbol Alpysbayev
Nov 13 '18 at 11:26
1
You didn't answer about bundling though
– Nurbol Alpysbayev
Nov 13 '18 at 11:32
1
Every time you make some edits to your code, as well as when installing a package, you have to rebuild (re-bundle) your project. So if you use Webpack (
npm run build
), you should run it. If you use create-react-app, you should runnpm start
– Nurbol Alpysbayev
Nov 13 '18 at 11:39
1
Sorry I ran out of ideas. My guesses is something is wrong with your build process, or maybe... there's a hidden character in the module name (I would retype it by hand) :D
– Nurbol Alpysbayev
Nov 13 '18 at 11:47