Error with scss when importing to index.js

1.8k views Asked by At

I have installed node sass converted my css to scss. Imported my main.scss into my index.js. Then I try to run it and I get that error.

Error I am getting in the console

1

There are 1 answers

0
Saurabh Sharma On

Your scss files are being parsed by babel-loader which is causing the above error. If you are using webpack, you need to add sass-loader into the config to parse the required files.

If you are using create-react-app, you need to install node-sass and it should work.

$ npm install node-sass --save-dev