"File to import not found or unreadable" When @import scss file from node_modules
Created by: vynogradskyi
Not sure if it is an actual bug or my curly hands, but i tried to provide as more details as possible to help solve this problem.
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Environment
-
node -v
: 6.9.5 -
npm -v
:4.6.1 -
npm ls react-scripts
(if you haven’t ejected): react-scripts@1.0.10
Then, specify:
- Operating system: Windows 10
Steps to Reproduce
(Write your steps here:)
- create-react-app test && cd test
- Make changes according to scss section
- npm install react-select (actually any module with scss files should reproduce)
- add
@import "~react-select\scss\default.scss
&& npm start - see build error:
{ "status": 1, "file": "{my local path here}/test/src/App.scss", "line": 1, "column": 1, "message": "File to import not found or unreadable: ~react-select/scss/default.\nParent style sheet: {my local path here}//test/src/App.scss", "formatted": "Error: File to import not found or unreadable: ~react-select/scss/default.\n Parent style sheet: {my local path here}/test/src/App.scss\n on line 1 of src/App.scss\n>> @import \"~react-select/scss/default\";\ n ^\n" }
Expected Behavior
Just normal scss compile, coz it OK works for files not from node modules. BTW importing css works fine from node_modules
Actual Behavior
{ "status": 1, "file": "{my local path here}/test/src/App.scss", "line": 1, "column": 1, "message": "File to import not found or unreadable: ~react-select/scss/default.\nParent style sheet: {my local path here}//test/src/App.scss", "formatted": "Error: File to import not found or unreadable: ~react-select/scss/default.\n Parent style sheet: {my local path here}/test/src/App.scss\n on line 1 of src/App.scss\n>> @import \"~react-select/scss/default\";\ n ^\n" }