I have a react.js project that another developer claims it works fine with his windows 10 OS. But for me when I tried to get the project up and running, I got this error message.
@import "styles/config";
SassError: Can't find stylesheet to import. ╷ 1 │ @import "styles/config"; │ ^^^^^^^^^^^^^^^ ╵
src/components/avatar/avatar.module.scss 1:9 root stylesheet
As far as I understand avatar.module.scss can't import the scss file. This is the folder structure
And in the .env file it has a record
SASS_PATH=./node_modules;./src
I assume this is the case. I think is not working in the Linux environment. I am running React app in normal react script
"start": "react-scripts start",
And the sass version in the package.json is this
"sass": "1.32.8"
How do I fix this and get this project up and running? and also I can't adjust the import statement for something like this @import "../../styles/config"; Because there are so many places and this code already works in the Windows environment.
Probably you need to add the underscore in the import:
@import "styles/_config.scss";